Skip to content

Commit

Permalink
[PRISM] Enable RubyVM tests for prism
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton committed May 3, 2024
1 parent 56672c8 commit 461d6d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion test/.excludes-prism/TestRubyVM.rb

This file was deleted.

9 changes: 9 additions & 0 deletions test/ruby/test_rubyvm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def foo
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
Expand Down Expand Up @@ -68,4 +69,12 @@ def test_keep_script_lines
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

0 comments on commit 461d6d4

Please sign in to comment.