Verifies: SYS-REQ-014 [malformed] MCDC SYS-REQ-014: N/A
(t *testing.T)
| 365 | // Verifies: SYS-REQ-014 [malformed] |
| 366 | // MCDC SYS-REQ-014: N/A |
| 367 | func TestParseStringAndEscapeSupplementalCoverage(t *testing.T) { |
| 368 | t.Run("decodeSingleUnicodeEscape rejects bad hex in each leading position", func(t *testing.T) { |
| 369 | inputs := []string{`\ux234`, `\u1x34`, `\u12x4`} |
| 370 | for _, in := range inputs { |
| 371 | if _, ok := decodeSingleUnicodeEscape([]byte(in)); ok { |
| 372 | t.Fatalf("decodeSingleUnicodeEscape(%q) unexpectedly succeeded", in) |
| 373 | } |
| 374 | } |
| 375 | }) |
| 376 | |
| 377 | t.Run("unescapeToUTF8 rejects non backslash prefix", func(t *testing.T) { |
| 378 | if inLen, outLen := unescapeToUTF8([]byte("x1"), make([]byte, 8)); inLen != -1 || outLen != -1 { |
| 379 | t.Fatalf("unescapeToUTF8(non-escape) = (%d, %d), want (-1, -1)", inLen, outLen) |
| 380 | } |
| 381 | }) |
| 382 | } |
| 383 | |
| 384 | // Verifies: SYS-REQ-014 [fuzz] |
| 385 | // MCDC SYS-REQ-014: N/A |
nothing calls this directly
no test coverage detected
searching dependent graphs…