Commit df58640
committed
test: add failing tests for multi-line token JSON serialization bug
These tests demonstrate that scanSync throws 'Bad control character in
string literal' when scanning SQL with multi-line tokens (dollar-quoted
function bodies, tabs, multi-line C-style comments).
The root cause is that build_scan_json() in wasm_wrapper.c only escapes
'"' and '\\' in token text, but not '\n', '\r', '\t'. When token text
contains literal newlines, the JSON output has unescaped control chars
that break JSON.parse.
These tests are expected to FAIL on this branch (no fix applied).
See PR #147 for the fix.1 parent 8ad9a92 commit df58640
1 file changed
Lines changed: 45 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
228 | 272 | | |
229 | | - | |
| 273 | + | |
0 commit comments