We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b1a1889 commit 5a2f88cCopy full SHA for 5a2f88c
pkg/yaml/formattest/testcase.go
@@ -23,6 +23,7 @@ import (
23
"path/filepath"
24
"testing"
25
26
+ "github.com/google/go-cmp/cmp"
27
"github.com/google/yamlfmt/pkg/yaml"
28
)
29
@@ -77,8 +78,9 @@ func (tc formatTestCase) Run(t *testing.T) {
77
78
if err != nil {
79
t.Fatal(err)
80
}
- if buf.String() != string(expected) {
81
- t.Fatalf("expected:\n%s\nactual:\n%s", string(expected), buf.String())
+
82
+ if diff := cmp.Diff(string(expected), buf.String()); diff != "" {
83
+ t.Fatalf("Encode() result differs (-want/+got):\n%s", diff)
84
85
})
86
0 commit comments