Skip to content

Commit 53b022d

Browse files
committed
. B fix issue with approval file names breaking go verification
1 parent cebe19d commit 53b022d

7 files changed

+12
-9
lines changed

approvals_test.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,19 @@ func TestVerifyJSONBytesWithScrubbedIds(t *testing.T) {
144144
func TestVerifyJSONBytesAcceptsValidJSONTypes(t *testing.T) {
145145
t.Parallel()
146146
for _, tc := range []struct {
147+
name string
147148
json string
148149
}{
149-
{json: "[1, 2, 3]"},
150-
{json: "{\"foo\": \"bar\"}"},
151-
{json: "1"},
152-
{json: "1.0"},
153-
{json: "1.0e10"},
154-
{json: "true"},
155-
{json: "false"},
156-
{json: "null"},
150+
{name: "array", json: "[1, 2, 3]"},
151+
{name: "object", json: "{\"foo\": \"bar\"}"},
152+
{name: "number", json: "1"},
153+
{name: "float", json: "1.0"},
154+
{name: "exponential", json: "1.0e10"},
155+
{name: "true", json: "true"},
156+
{name: "false", json: "false"},
157+
{name: "null", json: "null"},
157158
} {
158-
t.Run(tc.json, func(t *testing.T) {
159+
t.Run(tc.name, func(t *testing.T) {
159160
VerifyJSONBytes(t, []byte(tc.json))
160161
})
161162
}

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
module github.com/approvals/go-approval-tests
22

33
go 1.18
4+
5+
retract v1.9.0 // This version is broken, please use v1.9.1 instead.

testdata/approvals_test.TestVerifyJSONBytesAcceptsValidJSONTypes.[1,_2,_3].approved.json renamed to testdata/approvals_test.TestVerifyJSONBytesAcceptsValidJSONTypes.array.approved.json

File renamed without changes.

testdata/approvals_test.TestVerifyJSONBytesAcceptsValidJSONTypes.1.0e10.approved.json renamed to testdata/approvals_test.TestVerifyJSONBytesAcceptsValidJSONTypes.exponential.approved.json

File renamed without changes.

testdata/approvals_test.TestVerifyJSONBytesAcceptsValidJSONTypes.1.0.approved.json renamed to testdata/approvals_test.TestVerifyJSONBytesAcceptsValidJSONTypes.float.approved.json

File renamed without changes.

testdata/approvals_test.TestVerifyJSONBytesAcceptsValidJSONTypes.1.approved.json renamed to testdata/approvals_test.TestVerifyJSONBytesAcceptsValidJSONTypes.number.approved.json

File renamed without changes.

testdata/approvals_test.TestVerifyJSONBytesAcceptsValidJSONTypes.{"foo":_"bar"}.approved.json renamed to testdata/approvals_test.TestVerifyJSONBytesAcceptsValidJSONTypes.object.approved.json

File renamed without changes.

0 commit comments

Comments
 (0)