Add LibParseMeta.lookupWord unit test#534
Conversation
Adds a direct unit test for LibParseMeta.lookupWord covering both the hit path (word found, exact opcode index returned) and the miss path (word not found, found-flag false and index zero). Meta is built via LibGenParseMeta.buildParseMetaV2 from AuthoringMetaV2 words, matching how the rainlang parser consumes lookupWord. Closes #249 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 45 minutes and 38 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (37)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Adds a direct unit test for
LibParseMeta.lookupWord(defined in therain-interpreter-interfacedependency and consumed by the rainlang parser viaLibParse/BaseRainlangSubParser). The test covers both paths with discriminating assertions:LibGenParseMeta.buildParseMetaV2, looks each up, assertsexists == trueand the exact returned opcodeindexmatches the authoring position.exists == falseandindex == 0.Tests:
testLibParseMetaLookupWordKnown— three known words resolve to indices 0/1/2.testLibParseMetaLookupWordNotFound— an absent word is not found, index 0.testLibParseMetaLookupWordSingleDepth— single word at depth 1 found at index 0; unrelated word not found.testLibParseMetaLookupWordRoundtripFuzz— fuzzed words round-trip to their indices; an unrelated word is not found.Placed at
test/src/lib/parse/LibParseMeta.lookupWord.t.sol, mirroring theLibParseMetaimport path per the source-organized test convention.Mutation-validated: forcing the hit return to
(true, 0)fails the index assertions (Known,RoundtripFuzz); forcing the bit-not-set miss return to(true, 0)fails the found-flag assertions (NotFound,SingleDepth,RoundtripFuzz). Restored to baseline, all 4 tests green. Test-only change; no source/bytecode change.Closes #249
🤖 Generated with Claude Code