diff options
author | Luke Shumaker <lukeshu@datawire.io> | 2022-08-16 02:22:23 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@datawire.io> | 2022-08-16 02:29:04 -0600 |
commit | 9f75bb80b99f94c5c87582acb99e57c232caf01d (patch) | |
tree | 5da3c0cd1e62a09c3d77cb38dec1a67b931fa1fa /decode_scan_test.go | |
parent | 8c0513a04ff3870f57bde230507aaa8c6b7e6e86 (diff) |
Run the fuzzer a bit
Diffstat (limited to 'decode_scan_test.go')
-rw-r--r-- | decode_scan_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/decode_scan_test.go b/decode_scan_test.go index 5ad454f..1f04ead 100644 --- a/decode_scan_test.go +++ b/decode_scan_test.go @@ -105,6 +105,13 @@ func TestRuneTypeScanner(t *testing.T) { {0, 0, RuneTypeEOF, nil}, {0, 0, RuneTypeEOF, nil}, }}, + "syntax-error": {`[[0,]`, []ReadRuneTypeResult{ + {'[', 1, RuneTypeArrayBeg, nil}, + {'[', 1, RuneTypeArrayBeg, nil}, + {'0', 1, RuneTypeNumberIntZero, nil}, + {',', 1, RuneTypeArrayComma, nil}, + {']', 1, RuneTypeError, &DecodeSyntaxError{Offset: 5, Err: fmt.Errorf("invalid character %q looking for beginning of value", ']')}}, + }}, } for tcName, tc := range testcases { t.Run(tcName, func(t *testing.T) { |