test(parse): assert authoringMetaV2 word names, descriptions, and input counts#187
test(parse): assert authoringMetaV2 word names, descriptions, and input counts#187thedavidmeister wants to merge 1 commit into
Conversation
…ut counts Decodes authoringMetaV2() and asserts: - array length equals SUB_PARSER_WORD_PARSERS_LENGTH - each index holds the expected word name - all description strings are non-empty - ftso-current-price-usd description mentions "2 inputs" - ftso-current-price-pair description mentions "3 inputs" Closes #84 Co-Authored-By: Claude <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 3 minutes Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable usage-based reviews in Billing to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). How can I continue?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 reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. 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, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information, and refer to the rate limits docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
Summary
The existing
testSubParserParseMetaonly asserts that the SUB_PARSER_PARSE_META hash matches a hash re-derived fromauthoringMetaV2(). Because the parse-meta hash depends only on word names (not description strings), a typo or word-name swap between entries with identical handler signatures would pass undetected.This PR adds a dedicated test contract that decodes
authoringMetaV2()directly and asserts:SUB_PARSER_WORD_PARSERS_LENGTH(3)"ftso-current-price-usd", index 1"ftso-current-price-pair", index 2"sflr-exchange-rate"— catches any index swap"2 inputs"and the pair description mentions"3 inputs"— catches any silent content regressionCloses #84
Test plan
forge test --match-contract LibFlareFtsoSubParserAuthoringMetaTest— 5 tests passed, 0 failedforge test --no-match-test fork— 60 tests passed, 0 failedCo-Authored-By: Claude noreply@anthropic.com