Background
qjson is a single-document parser — it does not provide a native NDJSON API. Callers split lines themselves and call qjson_parse() per record. This means most NDJSON edge cases (empty lines, CRLF, whitespace-only lines, error recovery) are caller responsibility.
Goal
Add systematic edge case coverage for scenarios that ARE qjson's responsibility when parsing individual NDJSON records.
Scope
Edge Cases to Cover
| Edge Case |
qjson Responsibility |
Rationale |
| UTF-8 BOM at input start |
Yes |
RFC 8259 prohibits BOM; qjson should reject |
| Large single record (1MB+) |
Yes |
Verify no stack overflow or perf regression |
| Many small records (10K+) |
Yes |
Verify no memory leaks in parse/free cycle |
Out of Scope (Caller Responsibility)
- Empty lines / whitespace-only lines → caller's split logic
- CRLF vs LF handling → caller's line trimming
- Malformed middle record error recovery → caller decides whether to continue
- Streaming NDJSON → qjson requires full buffer per record
Acceptance Criteria
Technical Notes
- Follow existing test patterns from
ffi_depth_stress.rs
- Use
DocGuard RAII pattern for cleanup
- BOM bytes:
\xef\xbb\xbf (UTF-8 BOM)
References
Background
qjson is a single-document parser — it does not provide a native NDJSON API. Callers split lines themselves and call
qjson_parse()per record. This means most NDJSON edge cases (empty lines, CRLF, whitespace-only lines, error recovery) are caller responsibility.Goal
Add systematic edge case coverage for scenarios that ARE qjson's responsibility when parsing individual NDJSON records.
Scope
Edge Cases to Cover
Out of Scope (Caller Responsibility)
Acceptance Criteria
tests/ndjson_edge_cases.rswith:Technical Notes
ffi_depth_stress.rsDocGuardRAII pattern for cleanup\xef\xbb\xbf(UTF-8 BOM)References