summaryrefslogtreecommitdiff
path: root/test/ruby/test_rubyvm.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_rubyvm.rb')
-rw-r--r--test/ruby/test_rubyvm.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/ruby/test_rubyvm.rb b/test/ruby/test_rubyvm.rb
index d0b7cba341..053a914a8a 100644
--- a/test/ruby/test_rubyvm.rb
+++ b/test/ruby/test_rubyvm.rb
@@ -4,11 +4,9 @@ require 'test/unit'
class TestRubyVM < Test::Unit::TestCase
def test_stat
assert_kind_of Hash, RubyVM.stat
- assert_kind_of Integer, RubyVM.stat[:class_serial]
RubyVM.stat(stat = {})
assert_not_empty stat
- assert_equal stat[:class_serial], RubyVM.stat(:class_serial)
end
def test_stat_unknown
@@ -34,6 +32,7 @@ class TestRubyVM < Test::Unit::TestCase
end
def test_keep_script_lines
+ omit if compiling_with_prism?
pend if ENV['RUBY_ISEQ_DUMP_DEBUG'] # TODO
prev_conf = RubyVM.keep_script_lines
@@ -70,4 +69,12 @@ 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