Migrate exception handling tests from Rust to Ruby integration tests#71
Merged
Conversation
The Rust exception tests in exceptions.rs were largely full-pipeline integration tests (parse → install → propagate → run_all) that duplicated coverage already provided by Ruby integration tests in test/exception_test.rb. Remove 15 redundant Rust tests and keep only the 2 true unit tests that verify internal scope state (rescue_variable_scope_restore and rescue_variable_scope_removal), which cannot be validated through the CLI. Add 6 unique test scenarios to Ruby side that were previously only covered in Rust: - nested begin/rescue union type - begin/ensure without rescue - rescue modifier same type dedup - ensure side effects - rescue qualified exception class (Net::HTTPError) - empty rescue body returns nil 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.
Motivation
The Rust exception tests in
exceptions.rswere largely full-pipeline integration tests (parse → install → propagate → run_all) that duplicated coverage already provided by Ruby integration tests intest/exception_test.rb. This is part of the ongoing effort to consolidate integration-level testing in the Ruby test suite and keep only true unit tests on the Rust side.Changes
Rust side (
core/src/analyzer/exceptions.rs):test_rescue_variable_scope_restore,test_rescue_variable_scope_removal) that verify internal scope state not accessible via CLIRuby side (
test/exception_test.rb):test_nested_begin_rescue_union_type— nested begin/rescue returns union of all branchestest_begin_ensure_only_no_false_positive— begin/ensure without rescue produces no false positivetest_rescue_modifier_same_type_dedup— rescue modifier with same type deduplicatestest_ensure_side_effects_no_false_positive— ensure block side effects don't cause false positivestest_rescue_qualified_exception_class— qualified exception class (Net::HTTPError) is handledtest_empty_rescue_body_returns_nil— empty rescue body infers nil typeChecked
cd core && cargo test --lib— all Rust tests passbundle exec rake test— all Ruby tests pass🤖 Generated with Claude Code