Fix test/ruby/test_rubyoptions.rb + --parser=prism

This commit is contained in:
Kevin Newton 2024-01-29 16:22:08 -05:00
parent 3fb741069d
commit 2d6f7d0864

View File

@ -10,6 +10,11 @@ class TestRubyOptions < Test::Unit::TestCase
def self.rjit_enabled? = defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?
def self.yjit_enabled? = defined?(RubyVM::YJIT.enabled?) && RubyVM::YJIT.enabled?
# Here we're defining our own RUBY_DESCRIPTION without "+PRISM". We do this
# here so that the various tests that reference RUBY_DESCRIPTION don't have to
# worry about it. The flag itself is tested in its own test.
RUBY_DESCRIPTION = ::RUBY_DESCRIPTION.sub(/\+PRISM /, '')
NO_JIT_DESCRIPTION =
if rjit_enabled?
RUBY_DESCRIPTION.sub(/\+RJIT /, '')