decoder_test use reflect.DeepEqual more sensibly

This commit is contained in:
Lang Martin 2019-04-25 08:00:34 -04:00
parent 5eb0f21a30
commit f5f70d661b

View File

@ -804,18 +804,14 @@ func TestDecode_structureMapExtraKeys(t *testing.T) {
var p hclVariable var p hclVariable
ast, _ := Parse(testReadFile(t, "structure_map_extra_keys.hcl")) ast, _ := Parse(testReadFile(t, "structure_map_extra_keys.hcl"))
DecodeObject(&p, ast) DecodeObject(&p, ast)
if !(p.A == q.A && p.B == q.B && if !reflect.DeepEqual(p, q) {
reflect.DeepEqual(p.Found, q.Found) &&
reflect.DeepEqual(p.Extra, q.Extra)) {
t.Fatal("not equal") t.Fatal("not equal")
} }
var j hclVariable var j hclVariable
ast, _ = Parse(testReadFile(t, "structure_map_extra_keys.json")) ast, _ = Parse(testReadFile(t, "structure_map_extra_keys.json"))
DecodeObject(&j, ast) DecodeObject(&j, ast)
if !(j.A == q.A && j.B == q.B && if !reflect.DeepEqual(p, j) {
reflect.DeepEqual(j.Found, q.Found) &&
reflect.DeepEqual(j.Extra, q.Extra)) {
t.Fatal("not equal") t.Fatal("not equal")
} }
} }