Migrate return and loop tests from Rust to Ruby integration tests#70
Merged
Migrate return and loop tests from Rust to Ruby integration tests#70
Conversation
Rust-side tests in returns.rs and loops.rs were full-pipeline integration tests (parse → install → propagate → run_all) that duplicated coverage already provided by Ruby integration tests. This PR moves UNIQUE scenarios to Ruby and removes REDUNDANT Rust tests, keeping only true unit tests that verify internal state not accessible via CLI. returns.rs: remove all 7 tests (all REDUNDANT or UNIQUE now in Ruby) loops.rs: remove 7 tests, keep 3 UNIT tests (variable assignment, for-variable type inference, for-variable scope persistence) Ruby additions: - return_test.rb: dead code over-approximation test - loop_test.rb: while modifier form, begin-end-while, for empty body Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
eeaebc2 to
8aee4d7
Compare
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.
Motivation
Rust-side tests in
returns.rsandloops.rswere full-pipeline integration tests (parse → install → propagate → run_all) that duplicated coverage already provided by Ruby integration tests. This creates maintenance burden and obscures the boundary between unit tests and integration tests.Rust tests should only verify internal state not accessible via CLI, while end-to-end type inference results should be validated by Ruby integration tests.
Changes
Rust (removals)
returns.rs: Remove all 7 tests (entire#[cfg(test)]module) — all were REDUNDANT withreturn_test.rbor UNIQUE scenarios now migrated to Rubyloops.rs: Remove 7 tests and unused helperget_type_show— keep 3 UNIT tests:test_while_variable_assignment_in_body(variable assignment smoke test)test_for_variable_type_from_array(type inference verification)test_for_variable_persists_after_loop(Ruby scope semantics verification)Ruby (additions)
return_test.rb: Addtest_return_dead_code_over_approximation— verifies union type for dead code after returnloop_test.rb: Add 3 tests:test_while_modifier_form_no_error— while modifier syntaxtest_begin_end_while_no_error— begin-end-while looptest_for_empty_body_no_error— for loop with empty bodyChecked
cd core && cargo test --lib— all tests passbundle exec rake test— all tests pass🤖 Generated with Claude Code