Verifies: SYS-REQ-045 [boundary] stringEnd returns -1 when no closing quote found. Callers must handle.
(t *testing.T)
| 135 | // Verifies: SYS-REQ-045 [boundary] |
| 136 | // stringEnd returns -1 when no closing quote found. Callers must handle. |
| 137 | func TestStringEndSentinel(t *testing.T) { |
| 138 | // No closing quote |
| 139 | idx, _ := stringEnd([]byte(`hello`)) |
| 140 | if idx != -1 { |
| 141 | t.Fatalf("stringEnd(no closing quote) = %d, want -1", idx) |
| 142 | } |
| 143 | |
| 144 | // Proper closing quote |
| 145 | idx2, _ := stringEnd([]byte(`hello"`)) |
| 146 | if idx2 < 0 { |
| 147 | t.Fatalf("stringEnd(with closing quote) = %d, want non-negative", idx2) |
| 148 | } |
| 149 | |
| 150 | // Empty input |
| 151 | idx3, _ := stringEnd([]byte(``)) |
| 152 | if idx3 != -1 { |
| 153 | t.Fatalf("stringEnd(empty) = %d, want -1", idx3) |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | // Verifies: SYS-REQ-046 [boundary] |
| 158 | // blockEnd returns -1 when no matching closing bracket/brace found. |
nothing calls this directly
no test coverage detected
searching dependent graphs…