Skip to content

IronRuby.Tests: port the interop behaviour only the deleted Tests/Interop checked - #142

Merged
Largo merged 1 commit into
masterfrom
claude/port-interop-specs
Nov 7, 2026
Merged

Largo merged 1 commit into
masterfrom
claude/port-interop-specs

Conversation

@Largo

@Largo Largo commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

#119 deleted Tests/Interop, the old .NET interop mspec suite. Nothing ran it any more: it needed C# fixtures compiled from heredocs and a 2009 mspec. An audit of its 264 spec files found:

category spec files
empty "needs to be reviewed" stubs 132
COM/Office, IronPython or ir.exe 9
covered by ClrBclTests and the other Clr* tests ~75
obsolete (Fixnum, taint, to_clr_array, metaclass, …) ~13
behaviour no test covered ~35

Nearly all of that last group still works on master. This PR pins it down in Src/IronRuby.Tests/Runtime/ClrInteropSpecTests.cs, using BCL types only:

  • ClrInterop_EqualityHashing1: .NET Equals/GetHashCode of Ruby objects through eql?/hash. Also covers singleton overrides, separate definitions, and Ruby subclasses of CLR classes.
  • ClrInterop_Culture1: Float, format, Float() and BigDecimal under de-DE and ja-JP.
  • ClrInterop_DelegatesEvents1: delegates from blocks, Methods and lambdas, and the argument errors of a delegate type's new. A handler added twice fires twice, and removing it three times is no error.
  • ClrInterop_InterfaceEvents1: a Ruby class implementing INotifyPropertyChanged.PropertyChanged, both directly and through method_missing, subscribed from .NET.
  • ClrInterop_TypeModification1: including an interface after the first instance exists, allocators of abstract and static classes, and undef of CLR instance, static and singleton methods.
  • ClrInterop_Namespaces1: methods, module functions and Ruby classes added to and removed from a CLR namespace.

The bugs the audit found are filed separately: #140 (System::String#[String]) and #141 (Clr::Name.new(nil), new() constraint, generic inference from a Method, conversion messages).

Tested: the full IronRuby.Tests suite on Linux net10.0 (1,076 tests, all pass), and the six new tests on Windows 11 net10.0.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Expanded coverage for Ruby and .NET interoperability, including equality and hashing, culture-aware number formatting, delegates and events, interface implementations, type modification, and namespace behavior.
    • Added checks for expected results and error cases across these scenarios.

…erop checked

An audit of the Tests/Interop mspec suite that #119 deleted found about 35
spec files whose behaviour no IronRuby.Tests test covered. Nearly all of it
still works; these six tests pin it down with BCL types only (the old specs
needed C# fixtures compiled from heredocs):

- .NET Equals/GetHashCode of Ruby objects through eql?/hash, singletons,
  separate definitions and Ruby subclasses of CLR classes
- number formatting and parsing under de-DE and ja-JP
- delegates from blocks, Methods and lambdas; a handler added twice, removed
  three times (BindingList#ListChanged)
- a Ruby class implementing INotifyPropertyChanged's event, directly and
  through method_missing
- include after first instantiation, allocators of abstract/static classes,
  undef of CLR instance, static and singleton methods
- methods, module functions and Ruby classes added to a CLR namespace

The bugs the audit found are filed separately (#140, #141).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The test suite adds six output-based CLR interop tests. The test-runner action list now includes these tests.

Changes: CLR Interop Tests

Layer / File(s) Summary
Equality, hashing, and culture coverage
Src/IronRuby.Tests/RubyTests.cs, Src/IronRuby.Tests/Runtime/ClrInteropSpecTests.cs
The action list registers the new tests. The test suite checks CLR equality and hashing, and Ruby number formatting and parsing under de-DE and ja-JP.
Delegate and event coverage
Src/IronRuby.Tests/Runtime/ClrInteropSpecTests.cs
The tests cover delegate invocation and construction, event subscription and removal, and Ruby implementations of interface events.
CLR type and namespace coverage
Src/IronRuby.Tests/Runtime/ClrInteropSpecTests.cs
The tests cover interface inclusion, CLR allocation and method removal, namespace modification, and short-name type lookup.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: claude

Merge Risk: Minimal · up to 74306

The added CLR interop coverage is ready to merge after normal checks.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: porting interop behaviour that only the deleted Tests/Interop specs checked into the IronRuby.Tests suite. The raw summary shows ClrInteropSpecTests.cs added with six …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: porting interop behaviour that only the deleted Tests/Interop specs checked into the IronRuby.Tests suite. The raw summary shows ClrInteropSpecTests.cs added with six CLR interop tests (equality and hashing, culture, delegates and events, interface events, type modification, namespaces), which matches the title's scope. The title is somewhat long at 81 characters, but it is specific and descriptive, and it does not describe anything absent from the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c7f70cf and 7430656.

Files selected for processing: 2

  • Src/IronRuby.Tests/RubyTests.cs
  • Src/IronRuby.Tests/Runtime/ClrInteropSpecTests.cs

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.

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