@@ -25,7 +25,7 @@ import (
25
25
"strconv"
26
26
"testing"
27
27
28
- "github.com/davecgh /go-spew/spew "
28
+ "github.com/google /go-cmp/cmp "
29
29
yaml "gopkg.in/yaml.v2"
30
30
)
31
31
@@ -832,8 +832,8 @@ func TestJSONObjectToYAMLObject(t *testing.T) {
832
832
got := JSONObjectToYAMLObject (tt .input )
833
833
sortMapSlicesInPlace (tt .expected )
834
834
sortMapSlicesInPlace (got )
835
- if ! reflect .DeepEqual (got , tt .expected ) {
836
- t .Errorf ("jsonToYAML() = %v, want %v" , spew . Sdump ( got ), spew . Sdump ( tt .expected ))
835
+ if ! reflect .DeepEqual (tt .expected , got ) {
836
+ t .Errorf ("jsonToYAML() returned unexpected results (-want+got): \n %v" , cmp . Diff ( tt .expected , got ))
837
837
}
838
838
839
839
jsonBytes , err := json .Marshal (tt .input )
@@ -872,7 +872,8 @@ func TestJSONObjectToYAMLObject(t *testing.T) {
872
872
}
873
873
874
874
if ! reflect .DeepEqual (got , gotByRoundtrip ) {
875
- t .Errorf ("yaml.Unmarshal(json.Marshal(tt.input)) = %v, want %v\n json: %s" , spew .Sdump (gotByRoundtrip ), spew .Sdump (got ), string (jsonBytes ))
875
+ t .Errorf ("yaml.Unmarshal(json.Marshal(tt.input)) returned unexpected results (-want+got):\n %v" , cmp .Diff (got , gotByRoundtrip ))
876
+ t .Errorf ("json: %s" , string (jsonBytes ))
876
877
}
877
878
})
878
879
}
0 commit comments