diff --git a/dec_skip_cases_test.go b/dec_skip_cases_test.go index dfcdc82..664d34d 100644 --- a/dec_skip_cases_test.go +++ b/dec_skip_cases_test.go @@ -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 @@ -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{