Verifies: STK-REQ-001 [boundary] MCDC STK-REQ-001: N/A
(t *testing.T)
| 2290 | // Verifies: STK-REQ-001 [boundary] |
| 2291 | // MCDC STK-REQ-001: N/A |
| 2292 | func TestTokenStart(t *testing.T) { |
| 2293 | cases := []struct { |
| 2294 | name string |
| 2295 | input string |
| 2296 | expected int |
| 2297 | }{ |
| 2298 | {name: "comma separator", input: `{"a":1,"b":2`, expected: 6}, |
| 2299 | {name: "array separator", input: `[1,2`, expected: 2}, |
| 2300 | {name: "opening object", input: `{"a":1`, expected: 0}, |
| 2301 | {name: "no separator", input: `value`, expected: 0}, |
| 2302 | } |
| 2303 | |
| 2304 | for _, tc := range cases { |
| 2305 | if got := tokenStart([]byte(tc.input)); got != tc.expected { |
| 2306 | t.Fatalf("%s: tokenStart(%q) = %d, want %d", tc.name, tc.input, got, tc.expected) |
| 2307 | } |
| 2308 | } |
| 2309 | } |
| 2310 | |
| 2311 | var parseStringTest = []ParseTest{ |
| 2312 | { |
nothing calls this directly
no test coverage detected