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 Jun 29, 2021
1 parent 6f4e111 commit a74107a
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 @@ -461,6 +461,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 @@ -470,6 +471,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 @@ -491,6 +493,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 @@ -500,6 +503,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 @@ -527,7 +531,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 @@ -565,7 +569,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 a74107a

Please sign in to comment.