Skip to content

test: cover Lua encode error paths#90

Merged
membphis merged 1 commit into
mainfrom
codex/issue-65-encode-error-tests
May 30, 2026
Merged

test: cover Lua encode error paths#90
membphis merged 1 commit into
mainfrom
codex/issue-65-encode-error-tests

Conversation

@membphis
Copy link
Copy Markdown
Collaborator

Summary

  • Add Lua-level encode error coverage for non-finite numbers and unsupported Lua types.
  • Cover non-string object keys and document the current sparse-array rejection policy.
  • Assert empty object vs empty array encoding stays distinct and valid nested structures still encode.

Tests

  • DYLD_LIBRARY_PATH=./target/release LUA_PATH='./lua/?.lua;/usr/local/openresty/lualib/?.lua;/usr/local/openresty/lualib/?/init.lua;;' LUA_CPATH='./vendor/lua-cjson/?.so;./target/release/lib?.so;./?.so;/usr/local/openresty/lualib/?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so' env PATH="/Users/yuanshengwang/.luarocks/bin:$PATH" busted --lua=/opt/homebrew/bin/luajit tests/lua/encode_errors_spec.lua --lpath='./lua/?.lua'
  • env PATH="/Users/yuanshengwang/.luarocks/bin:$PATH" make test
  • make lint
  • cargo test --release --no-default-features
  • cargo test --features test-panic --release

Closes #65

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 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 8 minutes and 20 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 71981657-20ba-42fa-9612-ed982bc0d471

📥 Commits

Reviewing files that changed from the base of the PR and between 083791e and 7f20671.

📒 Files selected for processing (1)
  • tests/lua/encode_errors_spec.lua
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-65-encode-error-tests

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 f16bb3a into main May 30, 2026
11 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: Lua-level encode error coverage (NaN, type errors, sparse arrays)

1 participant