Add unit tests for blocks and parameters analyzers#60
Merged
Conversation
The blocks.rs module had only 3 low-level unit tests covering scope enter/exit and parameter registration, but lacked tests verifying end-to-end block type inference (e.g., block parameter types from collection elements, outer variable access, nested blocks). The parameters.rs module had 0 unit tests despite handling all method parameter types (required, optional, rest, keyword). This commit adds: - 5 tests to blocks.rs: block parameter type from array, external variable access, each_char block parameter, block body return type, nested blocks - 8 tests to parameters.rs: required/optional parameter type propagation, multiple parameters, keyword parameters, mixed positional/keyword, rest parameter, no-parameter method Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
blocks.rs(block parameter types from collections, outer variable access,each_charblock parameter, block body return type isolation, nested blocks)parameters.rs(required/optional parameter types, multiple parameters, required/optional keyword parameters, mixed positional/keyword, rest parameter, no-parameter method)blocks.rspreviously had only 3 low-level scope tests with no coverage of block type inference behaviorparameters.rspreviously had 0 unit tests despite handling all method parameter variantsTest plan
cd core && cargo test --libpasses with all new tests greenbundle exec rake test)🤖 Generated with Claude Code