Repository navigation
Update test_regexp.rb and test_marshal.rb from CRuby - #10127
Merged
Merged
Conversation
Contributor
Author
|
Review and merge order for the Regexp freeze work (Feature #8948):
|
This was referenced Nov 20, 2026
Copied whole from ruby/ruby@197b8f0103 (Ruby 4.1.0-dev). The new tests that fail on JRuby are excluded with the reason. test_dup and test_regexp2 now expect frozen Regexp instances (Feature jruby#8948). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zev
force-pushed
the
mri-sync-regexp-marshal
branch
from
November 24, 2026 03:36
1975f66 to
3b2324c
Compare
zev
marked this pull request as ready for review
December 1, 2026 03:33
Picks up ruby/ruby@20937c9b8e, which adds test_uclass_regexp_with_non_regexp_class: a TYPE_UCLASS record naming a class that is not a Regexp subclass around a Regexp must raise ArgumentError. JRuby already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
headius
approved these changes
Dec 1, 2026
headius
left a comment
Member
There was a problem hiding this comment.
Debating whether we should just tag off all of the remaining 4.1 failures with some text to indicate they are new 4.1 features and just let contributors remove the tags/excludes as they are fixed. Some excludes added here make me lean that way now.
Approved.
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.
Updates
test/mri/ruby/test_regexp.rbandtest_marshal.rbto current CRuby copies (Ruby 4.1.0-dev):test_regexp.rbfrom ruby/ruby@197b8f0103,test_marshal.rbfrom ruby/ruby@a37c2dbf1b. Both files are copied whole over the 4.0.9 copies from d7c208c, which have no JRuby edits.The Regexp freeze PR (#10128) needs this: CRuby changed three assertions in ruby/ruby@cb03bf43eb to expect frozen Regexp instances.
The second commit moves
test_marshal.rbto a37c2dbf1b for ruby/ruby@20937c9b8e, which addstest_uclass_regexp_with_non_regexp_class. That commit fixes a crash in CRuby's version of the Regexp freeze:Marshal.loadaccepted a non-Regexp user class around a Regexp. JRuby already raisesArgumentErrorthere, before and after #10128.test_regexp.rbstays at 197b8f0103; it has 35 later CRuby commits, mostly Onigmo fixes, which belong in their own sync.Excludes
Only additions; the existing excludes, including the ones added with the 4.0.9 sync, are unchanged. The new tests that fail on JRuby:
TestRegexp#test_dupandTestMarshal#test_regexp2: expect frozen Regexp instances. Freeze all instances of Regexp, except subclass instances #10128 removes these two.TestRegexp:test_extended_comment_compiled_again_for_string: an EMACS_MULE extended-mode comment gives 5 groups instead of 3. This passed onruby-4.1at e2ac87b and regressed since; not investigated yet.test_index_with_assertion_before_leading_anychar_star,test_rindex_with_leading_anychar_star_multiline:String#index/rindexreturnnil.test_s_timeout_corner_cases,test_timeout_corner_cases: noArgumentErrorfor out-of-range timeouts.test_extended_comment_invalid_unicode_escape_with_multibyte_characters:SyntaxError.test_once_implicit_match: needs investigation.test_match_aref,test_matchdata_large_capture_groups_stack,test_regsub_no_memory_leak_many_captures: needRbConfig::LIMITS,RubyVMorassert_no_memory_leak.TestMarshal:test_load_overread_string_body(same cause as the existingtest_load_overreadexclude),test_marshal_false_proc,test_modify_string_during_dump,test_uclass_module_not_relabeled,test_user_class_struct_size,test_continuation(needs callcc).TestMarshalFreeze#test_uclass_fstring.Several are real bugs worth separate fixes; I left them for follow-up PRs.
Testing
Both files, interpreter and forced JIT, on this branch merged with current
ruby-4.1: 0 failures (test_regexp.rb128 tests,test_marshal.rb196 tests; the new test also passes on theruby-4.1base).🤖 Generated with Claude Code