diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2024-08-28 16:35:03 -0400 |
|---|---|---|
| committer | Kevin Newton <kddnewton@gmail.com> | 2024-09-12 13:43:04 -0400 |
| commit | ea2af5782df63266577ba08a4ef4c30b6d63e564 (patch) | |
| tree | 1ef6184d389a1f95fa911f519c7d8c0091502f00 /test/ruby | |
| parent | f2919bd11c570fc5f5440d1f101be38f61e3d16b (diff) | |
Switch the default parser from parse.y to Prism
This commit switches the default parser to Prism. There are a
couple of additional changes related to this that are a part of
this as well to make this happen.
* Switch the default parser in parse.h
* Remove the Prism-specific workflow and add a parse.y-specific
workflow to CI so that it continues to be tested
* Update a few test exclusions since Prism has the correct
behavior but parse.y doesn't per
https://bugs.ruby-lang.org/issues/20504.
* Skips a couple of tests on RBS which are failing because they
are using RubyVM::AbstractSyntaxTree.of.
Fixes [Feature #20564]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11497
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_literal.rb | 5 | ||||
| -rw-r--r-- | test/ruby/test_m17n.rb | 8 | ||||
| -rw-r--r-- | test/ruby/test_mixed_unicode_escapes.rb | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb index 8732d8f0d0..9b294bc8ea 100644 --- a/test/ruby/test_literal.rb +++ b/test/ruby/test_literal.rb @@ -241,8 +241,9 @@ class TestRubyLiteral < Test::Unit::TestCase def test_dregexp assert_instance_of Regexp, /re#{'ge'}xp/ assert_equal(/regexp/, /re#{'ge'}xp/) - bug3903 = '[ruby-core:32682]' - assert_raise(SyntaxError, bug3903) {eval('/[#{"\x80"}]/')} + + # [ruby-core:32682] + eval('/[#{"\x80"}]/') end def test_array diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index 630ba269c0..93366ed02a 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -1439,20 +1439,20 @@ class TestM17N < Test::Unit::TestCase assert_regexp_usascii_literal('//', Encoding::US_ASCII) assert_regexp_usascii_literal('/#{ }/', Encoding::US_ASCII) assert_regexp_usascii_literal('/#{"a"}/', Encoding::US_ASCII) - assert_regexp_usascii_literal('/#{%q"\x80"}/', Encoding::ASCII_8BIT) - assert_regexp_usascii_literal('/#{"\x80"}/', nil, SyntaxError) + assert_regexp_usascii_literal('/#{%q"\x80"}/', Encoding::US_ASCII) + assert_regexp_usascii_literal('/#{"\x80"}/', Encoding::ASCII_8BIT) assert_regexp_usascii_literal('/a/', Encoding::US_ASCII) assert_regexp_usascii_literal('/a#{ }/', Encoding::US_ASCII) assert_regexp_usascii_literal('/a#{"a"}/', Encoding::US_ASCII) assert_regexp_usascii_literal('/a#{%q"\x80"}/', Encoding::ASCII_8BIT) - assert_regexp_usascii_literal('/a#{"\x80"}/', nil, SyntaxError) + assert_regexp_usascii_literal('/a#{"\x80"}/', Encoding::ASCII_8BIT) assert_regexp_usascii_literal('/\x80/', Encoding::ASCII_8BIT) assert_regexp_usascii_literal('/\x80#{ }/', Encoding::ASCII_8BIT) assert_regexp_usascii_literal('/\x80#{"a"}/', Encoding::ASCII_8BIT) assert_regexp_usascii_literal('/\x80#{%q"\x80"}/', Encoding::ASCII_8BIT) - assert_regexp_usascii_literal('/\x80#{"\x80"}/', nil, SyntaxError) + assert_regexp_usascii_literal('/\x80#{"\x80"}/', Encoding::ASCII_8BIT) assert_regexp_usascii_literal('/\u1234/', Encoding::UTF_8) assert_regexp_usascii_literal('/\u1234#{ }/', Encoding::UTF_8) diff --git a/test/ruby/test_mixed_unicode_escapes.rb b/test/ruby/test_mixed_unicode_escapes.rb index f0b4cc691f..a30b5c19f5 100644 --- a/test/ruby/test_mixed_unicode_escapes.rb +++ b/test/ruby/test_mixed_unicode_escapes.rb @@ -18,12 +18,12 @@ class TestMixedUnicodeEscape < Test::Unit::TestCase assert_raise(SyntaxError) { eval %q("\u{1234}")} # also should not work for Regexp - assert_raise(SyntaxError) { eval %q(/#{"\u1234"}#{""}/)} assert_raise(RegexpError) { eval %q(/\u{1234}#{nil}/)} assert_raise(RegexpError) { eval %q(/#{nil}\u1234/)} # String interpolation turns into an expression and we get # a different kind of error, but we still can't mix these + assert_raise(Encoding::CompatibilityError) { eval %q(/#{"\u1234"}#{""}/)} assert_raise(Encoding::CompatibilityError) { eval %q("\u{1234}#{nil}")} assert_raise(Encoding::CompatibilityError) { eval %q("#{nil}\u1234")} end |
