From 903d6f105584d0b91fc3c73ad0d12a3e22d5f545 Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Wed, 9 Feb 2022 17:15:53 -0500 Subject: [PATCH] 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. --- internal/lang/funcs/number_test.go | 4 ++-- internal/lang/funcs/redact_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/lang/funcs/number_test.go b/internal/lang/funcs/number_test.go index 260e0127c..6caf19af1 100644 --- a/internal/lang/funcs/number_test.go +++ b/internal/lang/funcs/number_test.go @@ -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(128).WithMarks(cty.NewValueMarks(marks.Raw, marks.Sensitive)), + cty.NumberIntVal(128).WithMarks(cty.NewValueMarks("boop", marks.Sensitive)), ``, }, { diff --git a/internal/lang/funcs/redact_test.go b/internal/lang/funcs/redact_test.go index b45721fb9..e378d5f5a 100644 --- a/internal/lang/funcs/redact_test.go +++ b/internal/lang/funcs/redact_test.go @@ -18,14 +18,14 @@ func TestRedactIfSensitive(t *testing.T) { marks: []cty.ValueMarks{cty.NewValueMarks(marks.Sensitive)}, want: "(sensitive value)", }, - "raw non-sensitive string": { + "marked non-sensitive string": { value: "foo", - marks: []cty.ValueMarks{cty.NewValueMarks(marks.Raw)}, + marks: []cty.ValueMarks{cty.NewValueMarks("boop")}, want: `"foo"`, }, - "raw sensitive string": { + "sensitive string with other marks": { 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)", }, "sensitive number": {