88 "testing"
99
1010 "github.com/google/go-cmp/cmp"
11- "github.com/hashicorp/hcl/v2"
1211 "github.com/zclconf/go-cty-debug/ctydebug"
1312 "github.com/zclconf/go-cty/cty"
1413)
@@ -33,15 +32,15 @@ func TestPathsWithMark(t *testing.T) {
3332 },
3433 {
3534 Path : cty .GetAttrPath ("deprecated" ),
36- Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" , nil )),
35+ Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" )),
3736 },
3837 {
3938 Path : cty .GetAttrPath ("multipleDeprecations" ),
40- Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" , nil ), NewDeprecation ("this is also deprecated" , nil )),
39+ Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" ), NewDeprecation ("this is also deprecated" )),
4140 },
4241 {
4342 Path : cty .GetAttrPath ("multipleDeprecationsAndSensitive" ),
44- Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" , nil ), NewDeprecation ("this is also deprecated" , nil ), "sensitive" ),
43+ Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" ), NewDeprecation ("this is also deprecated" ), "sensitive" ),
4544 },
4645 }
4746
@@ -72,15 +71,15 @@ func TestPathsWithMark(t *testing.T) {
7271 },
7372 {
7473 Path : cty .GetAttrPath ("deprecated" ),
75- Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" , nil )),
74+ Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" )),
7675 },
7776 {
7877 Path : cty .GetAttrPath ("multipleDeprecations" ),
79- Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" , nil ), NewDeprecation ("this is also deprecated" , nil )),
78+ Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" ), NewDeprecation ("this is also deprecated" )),
8079 },
8180 {
8281 Path : cty .GetAttrPath ("multipleDeprecationsAndSensitive" ),
83- Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" , nil ), NewDeprecation ("this is also deprecated" , nil ), "sensitive" ),
82+ Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" ), NewDeprecation ("this is also deprecated" ), "sensitive" ),
8483 },
8584 }
8685
@@ -117,7 +116,7 @@ func TestPathsWithMark(t *testing.T) {
117116 },
118117 {
119118 Path : cty .GetAttrPath ("multipleDeprecationsAndSensitive" ),
120- Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" , nil ), NewDeprecation ("this is also deprecated" , nil ), "sensitive" ),
119+ Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" ), NewDeprecation ("this is also deprecated" ), "sensitive" ),
121120 },
122121 }
123122
@@ -167,15 +166,15 @@ func TestRemoveAll_dataMarks(t *testing.T) {
167166 input := []cty.PathValueMarks {
168167 {
169168 Path : cty .GetAttrPath ("deprecated" ),
170- Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" , nil )),
169+ Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" )),
171170 },
172171 {
173172 Path : cty .GetAttrPath ("multipleDeprecations" ),
174- Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" , nil ), NewDeprecation ("this is also deprecated" , nil )),
173+ Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" ), NewDeprecation ("this is also deprecated" )),
175174 },
176175 {
177176 Path : cty .GetAttrPath ("multipleDeprecationsAndSensitive" ),
178- Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" , nil ), NewDeprecation ("this is also deprecated" , nil ), "sensitive" ),
177+ Marks : cty .NewValueMarks (NewDeprecation ("this is deprecated" ), NewDeprecation ("this is also deprecated" ), "sensitive" ),
179178 },
180179 }
181180
@@ -251,7 +250,7 @@ func TestMarkPaths(t *testing.T) {
251250 cty .GetAttrPath ("o" ).GetAttr ("b" ),
252251 cty .GetAttrPath ("t" ).IndexInt (0 ),
253252 }
254- deprecationMark := NewDeprecation ("this is deprecated" , nil )
253+ deprecationMark := NewDeprecation ("this is deprecated" )
255254 got = MarkPaths (value , deprecationMark , deprecatedPaths )
256255 want = cty .ObjectVal (map [string ]cty.Value {
257256 "s" : cty .StringVal (".s" ).Mark (deprecationMark ),
@@ -366,30 +365,30 @@ func TestMarksEqual(t *testing.T) {
366365 },
367366 {
368367 []cty.PathValueMarks {
369- {Path : cty.Path {cty.GetAttrStep {Name : "a" }}, Marks : cty .NewValueMarks (NewDeprecation ("same message" , nil ))},
368+ {Path : cty.Path {cty.GetAttrStep {Name : "a" }}, Marks : cty .NewValueMarks (NewDeprecation ("same message" ))},
370369 },
371370 []cty.PathValueMarks {
372- {Path : cty.Path {cty.GetAttrStep {Name : "a" }}, Marks : cty .NewValueMarks (NewDeprecation ("same message" , nil ))},
371+ {Path : cty.Path {cty.GetAttrStep {Name : "a" }}, Marks : cty .NewValueMarks (NewDeprecation ("same message" ))},
373372 },
374373 true ,
375374 },
376375 {
377376 []cty.PathValueMarks {
378- {Path : cty.Path {cty.GetAttrStep {Name : "a" }}, Marks : cty .NewValueMarks (NewDeprecation ("different" , nil ))},
377+ {Path : cty.Path {cty.GetAttrStep {Name : "a" }}, Marks : cty .NewValueMarks (NewDeprecation ("different" ))},
379378 },
380379 []cty.PathValueMarks {
381- {Path : cty.Path {cty.GetAttrStep {Name : "a" }}, Marks : cty .NewValueMarks (NewDeprecation ("message" , nil ))},
380+ {Path : cty.Path {cty.GetAttrStep {Name : "a" }}, Marks : cty .NewValueMarks (NewDeprecation ("message" ))},
382381 },
383382 false ,
384383 },
385384 {
386385 []cty.PathValueMarks {
387- {Path : cty.Path {cty.GetAttrStep {Name : "a" }}, Marks : cty .NewValueMarks (NewDeprecation ("same message" , & hcl. Range { Filename : "test.tf" , Start : hcl. Pos { Line : 1 , Column : 1 }, End : hcl. Pos { Line : 1 , Column : 1 }} ))},
386+ {Path : cty.Path {cty.GetAttrStep {Name : "a" }}, Marks : cty .NewValueMarks (NewDeprecation ("same message" ))},
388387 },
389388 []cty.PathValueMarks {
390- {Path : cty.Path {cty.GetAttrStep {Name : "a" }}, Marks : cty .NewValueMarks (NewDeprecation ("same message" , & hcl. Range { Filename : "otherFile.tf" , Start : hcl. Pos { Line : 1 , Column : 1 }, End : hcl. Pos { Line : 1 , Column : 1 }} ))},
389+ {Path : cty.Path {cty.GetAttrStep {Name : "a" }}, Marks : cty .NewValueMarks (NewDeprecation ("same message" ))},
391390 },
392- false , // TODO: Should this really be different?
391+ true ,
393392 },
394393 } {
395394 t .Run (fmt .Sprint (i ), func (t * testing.T ) {
0 commit comments