Skip to content

Commit

Permalink
Added the extra stdout message with test-unit
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Aug 30, 2021
1 parent c8a44e5 commit b153d58
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/irb/test_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ def test_eval_input_with_exception
if '2.5.0' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' && STDOUT.tty?
expected = [
:*, /Traceback \(most recent call last\):\n/,
:*, /\t... 8 levels...\n/,
:*, /\t 2: from \(irb\):1:in `<main>'\n/,
:*, /\t 1: from \(irb\):1:in `hoge'\n/,
:*, /\(irb\):1:in `fuga': unhandled exception\n/,
Expand All @@ -471,6 +472,7 @@ def test_eval_input_with_exception
:*, /\(irb\):1:in `fuga': unhandled exception\n/,
:*, /\tfrom \(irb\):1:in `hoge'\n/,
:*, /\tfrom \(irb\):1:in `<main>'\n/,
:*, /\t... 8 levels...\n/,
]
end
assert_pattern_list(expected, out)
Expand All @@ -492,6 +494,7 @@ def test_eval_input_with_invalid_byte_sequence_exception
if '2.5.0' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' && STDOUT.tty?
expected = [
:*, /Traceback \(most recent call last\):\n/,
:*, /\t... 8 levels...\n/,
:*, /\t 2: from \(irb\):1:in `<main>'\n/,
:*, /\t 1: from \(irb\):1:in `hoge'\n/,
:*, /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/,
Expand All @@ -501,6 +504,7 @@ def test_eval_input_with_invalid_byte_sequence_exception
:*, /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/,
:*, /\tfrom \(irb\):1:in `hoge'\n/,
:*, /\tfrom \(irb\):1:in `<main>'\n/,
:*, /\t... 8 levels...\n/,
]
end
assert_pattern_list(expected, out)
Expand Down Expand Up @@ -528,7 +532,7 @@ def test_eval_input_with_long_exception
if '2.5.0' <= RUBY_VERSION && RUBY_VERSION < '3.0.0' && STDOUT.tty?
expected = [
:*, /Traceback \(most recent call last\):\n/,
:*, /\t... 5 levels...\n/,
:*, /\t... 27 levels...\n/,
:*, /\t16: from \(irb\):1:in `a4'\n/,
:*, /\t15: from \(irb\):1:in `a5'\n/,
:*, /\t14: from \(irb\):1:in `a6'\n/,
Expand Down Expand Up @@ -566,7 +570,7 @@ def test_eval_input_with_long_exception
:*, /\tfrom \(irb\):1:in `a6'\n/,
:*, /\tfrom \(irb\):1:in `a5'\n/,
:*, /\tfrom \(irb\):1:in `a4'\n/,
:*, /\t... 5 levels...\n/,
:*, /\t... 27 levels...\n/,
]
end
assert_pattern_list(expected, out)
Expand Down

0 comments on commit b153d58

Please sign in to comment.