lang: Remove use of marks.Raw in tests

These instances of marks.Raw usage were semantically only testing the
properties of combining multiple marks. Testing this with an arbitrary
value for the mark is just as valid and clearer.
This commit is contained in:
Alisdair McDiarmid 2022-02-09 17:15:53 -05:00
parent 691b98b612
commit 903d6f1055
2 changed files with 6 additions and 6 deletions

View File

@ -215,9 +215,9 @@ func TestParseInt(t *testing.T) {
``, ``,
}, },
{ {
cty.StringVal("128").Mark(marks.Raw), cty.StringVal("128").Mark("boop"),
cty.NumberIntVal(10).Mark(marks.Sensitive), cty.NumberIntVal(10).Mark(marks.Sensitive),
cty.NumberIntVal(128).WithMarks(cty.NewValueMarks(marks.Raw, marks.Sensitive)), cty.NumberIntVal(128).WithMarks(cty.NewValueMarks("boop", marks.Sensitive)),
``, ``,
}, },
{ {

View File

@ -18,14 +18,14 @@ func TestRedactIfSensitive(t *testing.T) {
marks: []cty.ValueMarks{cty.NewValueMarks(marks.Sensitive)}, marks: []cty.ValueMarks{cty.NewValueMarks(marks.Sensitive)},
want: "(sensitive value)", want: "(sensitive value)",
}, },
"raw non-sensitive string": { "marked non-sensitive string": {
value: "foo", value: "foo",
marks: []cty.ValueMarks{cty.NewValueMarks(marks.Raw)}, marks: []cty.ValueMarks{cty.NewValueMarks("boop")},
want: `"foo"`, want: `"foo"`,
}, },
"raw sensitive string": { "sensitive string with other marks": {
value: "foo", value: "foo",
marks: []cty.ValueMarks{cty.NewValueMarks(marks.Raw), cty.NewValueMarks(marks.Sensitive)}, marks: []cty.ValueMarks{cty.NewValueMarks("boop"), cty.NewValueMarks(marks.Sensitive)},
want: "(sensitive value)", want: "(sensitive value)",
}, },
"sensitive number": { "sensitive number": {