From 801a11d0ab3e1d387b5aaed92d1965fbdf675780 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 23 Oct 2019 01:05:14 +0900 Subject: [PATCH] Relaxed tests for CPDEBUG mode --- bootstraptest/test_eval.rb | 3 ++- bootstraptest/test_jump.rb | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb index 8e90ac2728..fa04323b7f 100644 --- a/bootstraptest/test_eval.rb +++ b/bootstraptest/test_eval.rb @@ -190,7 +190,8 @@ assert_equal %q{[10, main]}, %q{ } %w[break next redo].each do |keyword| - assert_match %r"Can't escape from eval with #{keyword}\z", %{ + assert_match %r"Can't escape from eval with #{keyword}\b", %{ + STDERR.reopen(STDOUT) begin eval "0 rescue #{keyword}" rescue SyntaxError => e diff --git a/bootstraptest/test_jump.rb b/bootstraptest/test_jump.rb index 595aaa7c4b..7944915862 100644 --- a/bootstraptest/test_jump.rb +++ b/bootstraptest/test_jump.rb @@ -146,15 +146,16 @@ assert_equal %q{131}, %q{ end } } -assert_equal %q{ok}, %q{ +assert_match %r{Invalid retry}, %q{ +STDERR.reopen(STDOUT) begin eval %q{ 1.times{ retry } } -rescue SyntaxError - :ok +rescue SyntaxError => e + e.message end } assert_equal %q{3}, %q{