summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEarlopain <14981592+Earlopain@users.noreply.github.com>2026-01-12 14:21:42 +0100
committergit <svn-admin@ruby-lang.org>2026-01-12 22:08:25 +0000
commitee1aa78bee5f5c46ebcd75a3fe3eff03787b0b44 (patch)
treecd5878af549be8c6d462bf9bffb0d2d2454afd0d /test
parentd81a11d4e61f67b6fb0aaa44aaa7ead4022148dd (diff)
[ruby/prism] Correctly expose ripper state
It is for example used by `irb`, `rdoc`, `syntax_suggest` https://github.com/ruby/prism/commit/255aeb2485
Diffstat (limited to 'test')
-rw-r--r--test/prism/ruby/ripper_test.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb
index 9d64c5c70c..bbd85585a9 100644
--- a/test/prism/ruby/ripper_test.rb
+++ b/test/prism/ruby/ripper_test.rb
@@ -65,13 +65,12 @@ module Prism
# Check that the hardcoded values don't change without us noticing.
def test_internals
- actual = LexCompat::State::ALL
- expected = Ripper.constants.select { |name| name.start_with?("EXPR_") }
- expected -= %i[EXPR_VALUE EXPR_BEG_ANY EXPR_ARG_ANY EXPR_END_ANY]
+ actual = Translation::Ripper.constants.select { |name| name.start_with?("EXPR_") }.sort
+ expected = Ripper.constants.select { |name| name.start_with?("EXPR_") }.sort
- assert_equal(expected.size, actual.size)
- expected.each do |const_name|
- assert_equal(const_name.to_s.delete_prefix("EXPR_").to_sym, actual[Ripper.const_get(const_name)])
+ assert_equal(expected, actual)
+ expected.zip(actual).each do |ripper, prism|
+ assert_equal(Ripper.const_get(ripper), Translation::Ripper.const_get(prism))
end
end