summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2021-10-15 16:51:57 -0400
committerAlan Wu <[email protected]>2021-10-20 18:19:43 -0400
commit11096da6cc655b301b91e985e9ba1bad748e91bf (patch)
tree2fe798797e627cc55738f4352ac17f3174ff93bb /test
parentd11ea2520e24fdc7114a6400f00c96d241665bff (diff)
Improve YJIT command line option parsing
Previously, options such as "--yjit123" would enable YJIT. Additionally, the error message for argument parsing mentioned "--jit-..." instead of "--yjit-...".
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_yjit.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb
index 24c5c92818..0905b68218 100644
--- a/test/ruby/test_yjit.rb
+++ b/test/ruby/test_yjit.rb
@@ -29,6 +29,14 @@ class TestYJIT < Test::Unit::TestCase
end
end
+ def test_command_line_switches
+ assert_in_out_err('--yjit-', '', [], /invalid option --yjit-/)
+ assert_in_out_err('--yjithello', '', [], /invalid option --yjithello/)
+ assert_in_out_err('--yjit-call-threshold', '', [], /--yjit-call-threshold needs an argument/)
+ assert_in_out_err('--yjit-call-threshold=', '', [], /--yjit-call-threshold needs an argument/)
+ assert_in_out_err('--yjit-greedy-versioning=1', '', [], /warning: argument to --yjit-greedy-versioning is ignored/)
+ end
+
def test_enable_from_env_var
yjit_child_env = {'RUBY_YJIT_ENABLE' => '1'}
assert_in_out_err([yjit_child_env, '--version'], '', [RUBY_DESCRIPTION])