@@ -713,6 +713,35 @@ func TestAppendWithoutDuplicates(t *testing.T) {
713
713
},
714
714
},
715
715
},
716
+ "hcl.Diagnostic no-location" : {
717
+ // Extra can contain anything, and we don't know how to compare
718
+ // those values, so we can't dedupe them
719
+ func (diags Diagnostics ) Diagnostics {
720
+ diags = diags .Append (& hcl.Diagnostic {
721
+ Severity : hcl .DiagError ,
722
+ Summary : "Something bad happened" ,
723
+ Detail : "It was really, really bad." ,
724
+ })
725
+ diags = diags .Append (& hcl.Diagnostic {
726
+ Severity : hcl .DiagError ,
727
+ Summary : "Something bad happened" ,
728
+ Detail : "It was really, really bad." ,
729
+ })
730
+ return diags
731
+ },
732
+ []diagFlat {
733
+ {
734
+ Severity : Error ,
735
+ Summary : "Something bad happened" ,
736
+ Detail : "It was really, really bad." ,
737
+ },
738
+ {
739
+ Severity : Error ,
740
+ Summary : "Something bad happened" ,
741
+ Detail : "It was really, really bad." ,
742
+ },
743
+ },
744
+ },
716
745
}
717
746
718
747
for name , test := range tests {
@@ -736,9 +765,7 @@ func TestAppendWithoutDuplicates(t *testing.T) {
736
765
}
737
766
738
767
if ! reflect .DeepEqual (got , test .Want ) {
739
- // t.Errorf("wrong result\ngot: %swant: %s", spew.Sdump(got), spew.Sdump(test.Want))
740
768
t .Errorf ("wrong result\n got: %#v\n want: %#v" , got , test .Want )
741
-
742
769
}
743
770
})
744
771
}
0 commit comments