summaryrefslogtreecommitdiff
path: root/test/ruby/test_rubyvm.rb
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2024-07-18 15:04:55 -0400
committerKevin Newton <[email protected]>2024-07-18 21:15:54 -0400
commit1c81d1a69dfc909baf128d6d1ffe636f2e8a3194 (patch)
tree0834c78e22274666364d4b6ccfdff70598af997c /test/ruby/test_rubyvm.rb
parent69e65b9b5ad03d40eb6cfa7323d871465c28d960 (diff)
[PRISM] Refactor parser support into its own module
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11201
Diffstat (limited to 'test/ruby/test_rubyvm.rb')
-rw-r--r--test/ruby/test_rubyvm.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/test/ruby/test_rubyvm.rb b/test/ruby/test_rubyvm.rb
index 053a914a8a..225cb45f33 100644
--- a/test/ruby/test_rubyvm.rb
+++ b/test/ruby/test_rubyvm.rb
@@ -1,5 +1,6 @@
# frozen_string_literal: false
require 'test/unit'
+require_relative '../lib/parser_support'
class TestRubyVM < Test::Unit::TestCase
def test_stat
@@ -32,7 +33,7 @@ class TestRubyVM < Test::Unit::TestCase
end
def test_keep_script_lines
- omit if compiling_with_prism?
+ omit if ParserSupport.prism_enabled?
pend if ENV['RUBY_ISEQ_DUMP_DEBUG'] # TODO
prev_conf = RubyVM.keep_script_lines
@@ -69,12 +70,4 @@ class TestRubyVM < Test::Unit::TestCase
ensure
RubyVM.keep_script_lines = prev_conf
end
-
- private
-
- # RubyVM.keep_script_lines does not mean anything in the context of prism, so
- # we should omit tests that are looking for that functionality.
- def compiling_with_prism?
- RubyVM::InstructionSequence.compile("").to_a[4][:parser] == :prism
- end
end