Skip to content

test: add NDJSON edge case coverage#159

Merged
membphis merged 1 commit into
mainfrom
test/ndjson-edge-cases-154
Jun 2, 2026
Merged

test: add NDJSON edge case coverage#159
membphis merged 1 commit into
mainfrom
test/ndjson-edge-cases-154

Conversation

@membphis
Copy link
Copy Markdown
Collaborator

@membphis membphis commented Jun 2, 2026

Summary

Closes #154.

Add systematic edge case coverage for scenarios that are qjson's responsibility when parsing individual NDJSON records.

Changes

  • Add tests/ndjson_edge_cases.rs with 7 test cases:
    • BOM handling (3 tests): UTF-8 BOM rejection per RFC 8259 §8.1
    • Large records (2 tests): 1MB and 2MB single-record stress tests
    • Batch processing (2 tests): 10K+ parse/free cycles to catch memory leaks

What's NOT covered (caller responsibility)

  • Empty lines / whitespace-only lines → caller's split logic
  • CRLF vs LF handling → caller's line trimming
  • Error recovery across records → caller decides whether to continue

Testing

cargo test --release --test ndjson_edge_cases
make lint
make test

All 7 new tests pass in both EAGER and LAZY modes.

Add tests for edge cases that are qjson's responsibility when parsing
individual NDJSON records:

- UTF-8 BOM handling: verify EAGER mode rejects BOM-prefixed input per
  RFC 8259 section 8.1
- Large single record (1-2MB): verify no stack overflow or performance
  regression on large payloads
- Batch small records (10K+): verify no memory leaks in parse/free
  cycles, exercising typical NDJSON processing patterns

Note: qjson is a single-document parser. NDJSON support requires callers
to split lines and parse each record individually.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Warning

Review limit reached

@membphis, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 41 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7b5e328e-5541-4e15-a3c1-58e7bed65b3c

📥 Commits

Reviewing files that changed from the base of the PR and between 83c26ad and f36fca2.

📒 Files selected for processing (1)
  • tests/ndjson_edge_cases.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/ndjson-edge-cases-154

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@membphis membphis merged commit 80dbe2d into main Jun 2, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add NDJSON-specific edge case coverage

1 participant