diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-01-17 11:26:12 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-01-17 18:26:39 +0900 |
commit | 6215b5ba9811ae1a1e631f01a88fd5b32043effa (patch) | |
tree | 07ac079fb9764d22f6e8b67deb6376d119625539 /test/ruby/test_rubyoptions.rb | |
parent | 42168802618381b7b6308acc290aabdf61c10116 (diff) |
Fix off-by-one error of argc
Fix ruby/ruby#9562
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index b8327d15b5..e98bd9fb17 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -541,6 +541,16 @@ class TestRubyOptions < Test::Unit::TestCase /invalid name for global variable - -# \(NameError\)/) end + def test_option_missing_argument + assert_in_out_err(%w(-0 --enable), "", [], /missing argument for --enable/) + assert_in_out_err(%w(-0 --disable), "", [], /missing argument for --disable/) + assert_in_out_err(%w(-0 --dump), "", [], /missing argument for --dump/) + assert_in_out_err(%w(-0 --encoding), "", [], /missing argument for --encoding/) + assert_in_out_err(%w(-0 --external-encoding), "", [], /missing argument for --external-encoding/) + assert_in_out_err(%w(-0 --internal-encoding), "", [], /missing argument for --internal-encoding/) + assert_in_out_err(%w(-0 --backtrace-limit), "", [], /missing argument for --backtrace-limit/) + end + def test_assignment_in_conditional Tempfile.create(["test_ruby_test_rubyoption", ".rb"]) {|t| t.puts "if a = 1" |