Skip to content

Commit

Permalink
test: generate more skip cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Jan 12, 2022
1 parent 42962d1 commit 1610937
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions dec_skip_cases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,11 @@ func Test_skip(t *testing.T) {
`"\t"`, // valid
},
})
testCases = append(testCases, testCase{
ptr: (*[]interface{})(nil),
inputs: []string{
`[]`, // valid
`[1]`, // valid
`[ 1, "hello"]`, // valid
`[abc]`, // invalid
`[`, // invalid
`[[]`, // invalid
},
})
testCases = append(testCases, testCase{
numberCase := testCase{
ptr: (*float64)(nil),
inputs: []string{
"0", // valid
"-", // invalid
"+1", // invalid
"-a", // invalid
"-\x00", // invalid, zero byte
Expand Down Expand Up @@ -72,7 +62,23 @@ func Test_skip(t *testing.T) {
"10.", // invalid
"-0.12", // valid
},
})
}
testCases = append(testCases, numberCase)
arrayCase := testCase{
ptr: (*[]interface{})(nil),
inputs: []string{
`[]`, // valid
`[1]`, // valid
`[ 1, "hello"]`, // valid
`[abc]`, // invalid
`[`, // invalid
`[[]`, // invalid
},
}
for _, c := range numberCase.inputs {
arrayCase.inputs = append(arrayCase.inputs, `[`+c+`]`)
}
testCases = append(testCases, arrayCase)
testCases = append(testCases, testCase{
ptr: (*struct{})(nil),
inputs: []string{
Expand Down

0 comments on commit 1610937

Please sign in to comment.