[ruby/irb] Relax backtrace nest levels

https://github.com/ruby/irb/commit/fb637bc68f
This commit is contained in:
Nobuyoshi Nakada 2021-08-30 13:11:13 +09:00 committed by git
parent b17dc55017
commit 66a4768f65

View File

@ -462,7 +462,6 @@ module TestIRB
if '2.5.0' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' && STDOUT.tty? if '2.5.0' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' && STDOUT.tty?
expected = [ expected = [
:*, /Traceback \(most recent call last\):\n/, :*, /Traceback \(most recent call last\):\n/,
:*, /\t... 8 levels...\n/,
:*, /\t 2: from \(irb\):1:in `<main>'\n/, :*, /\t 2: from \(irb\):1:in `<main>'\n/,
:*, /\t 1: from \(irb\):1:in `hoge'\n/, :*, /\t 1: from \(irb\):1:in `hoge'\n/,
:*, /\(irb\):1:in `fuga': unhandled exception\n/, :*, /\(irb\):1:in `fuga': unhandled exception\n/,
@ -472,7 +471,7 @@ module TestIRB
:*, /\(irb\):1:in `fuga': unhandled exception\n/, :*, /\(irb\):1:in `fuga': unhandled exception\n/,
:*, /\tfrom \(irb\):1:in `hoge'\n/, :*, /\tfrom \(irb\):1:in `hoge'\n/,
:*, /\tfrom \(irb\):1:in `<main>'\n/, :*, /\tfrom \(irb\):1:in `<main>'\n/,
:*, /\t... 8 levels...\n/, :*
] ]
end end
assert_pattern_list(expected, out) assert_pattern_list(expected, out)
@ -494,7 +493,6 @@ module TestIRB
if '2.5.0' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' && STDOUT.tty? if '2.5.0' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' && STDOUT.tty?
expected = [ expected = [
:*, /Traceback \(most recent call last\):\n/, :*, /Traceback \(most recent call last\):\n/,
:*, /\t... 8 levels...\n/,
:*, /\t 2: from \(irb\):1:in `<main>'\n/, :*, /\t 2: from \(irb\):1:in `<main>'\n/,
:*, /\t 1: from \(irb\):1:in `hoge'\n/, :*, /\t 1: from \(irb\):1:in `hoge'\n/,
:*, /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/, :*, /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/,
@ -504,7 +502,7 @@ module TestIRB
:*, /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/, :*, /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/,
:*, /\tfrom \(irb\):1:in `hoge'\n/, :*, /\tfrom \(irb\):1:in `hoge'\n/,
:*, /\tfrom \(irb\):1:in `<main>'\n/, :*, /\tfrom \(irb\):1:in `<main>'\n/,
:*, /\t... 8 levels...\n/, :*
] ]
end end
assert_pattern_list(expected, out) assert_pattern_list(expected, out)
@ -532,7 +530,7 @@ module TestIRB
if '2.5.0' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' && STDOUT.tty? if '2.5.0' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' && STDOUT.tty?
expected = [ expected = [
:*, /Traceback \(most recent call last\):\n/, :*, /Traceback \(most recent call last\):\n/,
:*, /\t... 27 levels...\n/, :*, /\t... \d+ levels...\n/,
:*, /\t16: from \(irb\):1:in `a4'\n/, :*, /\t16: from \(irb\):1:in `a4'\n/,
:*, /\t15: from \(irb\):1:in `a5'\n/, :*, /\t15: from \(irb\):1:in `a5'\n/,
:*, /\t14: from \(irb\):1:in `a6'\n/, :*, /\t14: from \(irb\):1:in `a6'\n/,
@ -570,7 +568,7 @@ module TestIRB
:*, /\tfrom \(irb\):1:in `a6'\n/, :*, /\tfrom \(irb\):1:in `a6'\n/,
:*, /\tfrom \(irb\):1:in `a5'\n/, :*, /\tfrom \(irb\):1:in `a5'\n/,
:*, /\tfrom \(irb\):1:in `a4'\n/, :*, /\tfrom \(irb\):1:in `a4'\n/,
:*, /\t... 27 levels...\n/, :*, /\t... \d+ levels...\n/,
] ]
end end
assert_pattern_list(expected, out) assert_pattern_list(expected, out)