Verifies: SYS-REQ-014 [malformed] MCDC SYS-REQ-014: N/A
(t *testing.T)
| 86 | // Verifies: SYS-REQ-014 [malformed] |
| 87 | // MCDC SYS-REQ-014: N/A |
| 88 | func TestDecodeUnicodeEscape(t *testing.T) { |
| 89 | for _, test := range multiUnicodeEscapeTests { |
| 90 | r, len := decodeUnicodeEscape([]byte(test.in)) |
| 91 | isErr := (len == -1) |
| 92 | |
| 93 | if isErr != test.isErr { |
| 94 | t.Errorf("decodeUnicodeEscape(%s) returned isErr mismatch: expected %t, obtained %t", test.in, test.isErr, isErr) |
| 95 | } else if isErr { |
| 96 | continue |
| 97 | } else if len != test.len { |
| 98 | t.Errorf("decodeUnicodeEscape(%s) returned length mismatch: expected %d, obtained %d", test.in, test.len, len) |
| 99 | } else if r != test.out { |
| 100 | t.Errorf("decodeUnicodeEscape(%s) returned rune mismatch: expected %x (%c), obtained %x (%c)", test.in, test.out, test.out, r, r) |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | type unescapeTest struct { |
| 106 | in string // escaped string |
nothing calls this directly
no test coverage detected
searching dependent graphs…