mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 14:05:02 +02:00
Fix the precedence of --backtrace-limit
option
In general, if the same option specifying a single value is given multiple times at the same level, the last one overrides the earlier ones, unless prohibited.
This commit is contained in:
parent
546c5cfe4c
commit
b56e5c6b94
Notes:
git
2025-05-14 12:41:59 +00:00
2 changed files with 9 additions and 1 deletions
|
@ -89,6 +89,10 @@ class TestRubyOptions < Test::Unit::TestCase
|
|||
assert_in_out_err([env], "p Thread::Backtrace.limit", ['5'], [])
|
||||
assert_in_out_err([env, "--backtrace-limit=1"], "p Thread::Backtrace.limit", ['1'], [])
|
||||
assert_in_out_err([env, "--backtrace-limit=-1"], "p Thread::Backtrace.limit", ['-1'], [])
|
||||
assert_in_out_err([env, "--backtrace-limit=3", "--backtrace-limit=1"],
|
||||
"p Thread::Backtrace.limit", ['1'], [])
|
||||
assert_in_out_err([{"RUBYOPT" => "--backtrace-limit=5 --backtrace-limit=3"}],
|
||||
"p Thread::Backtrace.limit", ['3'], [])
|
||||
long_max = RbConfig::LIMITS["LONG_MAX"]
|
||||
assert_in_out_err(%W(--backtrace-limit=#{long_max}), "p Thread::Backtrace.limit",
|
||||
["#{long_max}"], [])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue