Skip to content

Migrate assignment and block tests from Rust to Ruby#72

Merged
dak2 merged 1 commit intomainfrom
migrate-exception-tests-to-ruby
Mar 20, 2026
Merged

Migrate assignment and block tests from Rust to Ruby#72
dak2 merged 1 commit intomainfrom
migrate-exception-tests-to-ruby

Conversation

@dak2
Copy link
Copy Markdown
Owner

@dak2 dak2 commented Mar 20, 2026

Motivation

The Rust test suites in assignments.rs (17 tests) and blocks.rs (8 tests) were dominated by full-pipeline integration tests that duplicated coverage already provided by Ruby integration tests. Per the test strategy rethink ,I migrate UNIQUE scenarios to Ruby and remove REDUNDANT Rust tests, keeping only true unit tests that verify internal state inaccessible via CLI.

Changes

Ruby additions

  • test/multi_assign_test.rb — 5 new tests:
    • test_splat_mixed_typesfirst, *rest = 1, "hello", :sym
    • test_splat_only*all = 1, 2, 3
    • test_array_literal_rhsa, b = [1, "hello"]
    • test_rights_exceed_rhsa, b, c = 1, 2 (c gets nil)
    • test_rhs_longer_than_lhsa, b = 1, 2, 3 (extra values dropped)
  • test/block_test.rb — 2 new tests:
    • test_block_parameter_from_each_char"hello".each_char { |c| c.upcase }
    • test_block_body_does_not_affect_method_return — block return type does not leak to method return

Rust removals

  • assignments.rs: 16 tests removed → 1 unit test retained (test_multi_write_does_not_panic_on_non_array_rhs)
  • blocks.rs: 5 tests removed → 3 unit tests retained (test_enter_exit_block_scope, test_install_block_parameter, test_block_inherits_parent_scope_vars)

Checked

  • cd core && cargo test --lib — all Rust tests pass
  • bundle exec rake test — all Ruby integration tests pass

🤖 Generated with Claude Code

The Rust test suite in assignments.rs and blocks.rs contained many
full-pipeline integration tests (parse → install → propagate → run_all)
that duplicated coverage already provided by Ruby integration tests.
This migrates UNIQUE test scenarios to Ruby and removes REDUNDANT Rust
tests, keeping only true unit tests that verify internal state.

Ruby additions:
- multi_assign_test.rb: splat mixed types, splat only, array literal
  RHS, rights exceed RHS, RHS longer than LHS
- block_test.rb: block parameter from each_char, block body does not
  affect method return

Rust removals:
- assignments.rs: 16 tests removed (1 unit test retained)
- blocks.rs: 5 tests removed (3 unit tests retained)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dak2 dak2 merged commit 483161d into main Mar 20, 2026
4 checks passed
@dak2 dak2 deleted the migrate-exception-tests-to-ruby branch March 20, 2026 14:34
@dak2 dak2 mentioned this pull request Mar 24, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant