helper/schema: More tests for Set.HashEqual
Just to make sure equality on outer and inner values does not affect anything.
This commit is contained in:
parent
ca42980e49
commit
287a5eb66a
|
@ -162,8 +162,18 @@ func TestHashEqual(t *testing.T) {
|
|||
"bar": "qux",
|
||||
"nested": NewSet(HashResource(nested), []interface{}{n2}),
|
||||
}
|
||||
r3 := map[string]interface{}{
|
||||
"bar": "baz",
|
||||
"nested": NewSet(HashResource(nested), []interface{}{n2}),
|
||||
}
|
||||
r4 := map[string]interface{}{
|
||||
"bar": "qux",
|
||||
"nested": NewSet(HashResource(nested), []interface{}{n1}),
|
||||
}
|
||||
s1 := NewSet(HashResource(root), []interface{}{r1})
|
||||
s2 := NewSet(HashResource(root), []interface{}{r2})
|
||||
s3 := NewSet(HashResource(root), []interface{}{r3})
|
||||
s4 := NewSet(HashResource(root), []interface{}{r4})
|
||||
|
||||
cases := []struct {
|
||||
name string
|
||||
|
@ -183,6 +193,18 @@ func TestHashEqual(t *testing.T) {
|
|||
compare: s2,
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "outer equal, should still not be equal",
|
||||
set: s1,
|
||||
compare: s3,
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "inner equal, should still not be equal",
|
||||
set: s1,
|
||||
compare: s4,
|
||||
expected: false,
|
||||
},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue