Skip to content

Commit

Permalink
tests: use cmp.Diff instead of godebug
Browse files Browse the repository at this point in the history
  • Loading branch information
willnorris committed Feb 23, 2024
1 parent 11ef700 commit 81ec362
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module willnorris.com/go/microformats
require (
github.com/PuerkitoBio/goquery v1.8.0
github.com/google/go-cmp v0.5.9
github.com/kylelemons/godebug v1.1.0
golang.org/x/net v0.2.0
)

Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x0
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
Expand Down
5 changes: 2 additions & 3 deletions testsuite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/kylelemons/godebug/pretty"
"willnorris.com/go/microformats"
)

Expand Down Expand Up @@ -106,7 +105,7 @@ func runTest(t *testing.T, test string) {
t.Fatalf("error unmarshaling json: %v", err)
}

if !cmp.Equal(got, want) {
t.Fatalf("Parse value differs:\n%v", pretty.Compare(want, got))
if diff := cmp.Diff(got, want); diff != "" {
t.Fatalf("Parse value differs:\n%v", diff)
}
}

0 comments on commit 81ec362

Please sign in to comment.