diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-15 19:31:48 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-15 19:39:47 +0900 |
commit | 0c6c937904aafc1809386bd892a2d114d22d01fe (patch) | |
tree | 15041535e5c64cddb0de4e6519211f9f9f80abf4 | |
parent | b452c03a14f943ae25338547bd680fce67399d85 (diff) |
Removed duplicate highlighting
-rw-r--r-- | eval_error.c | 2 | ||||
-rw-r--r-- | test/ruby/test_exception.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/eval_error.c b/eval_error.c index 6132cbe8c8..17c0e865b9 100644 --- a/eval_error.c +++ b/eval_error.c @@ -144,8 +144,6 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA write_warn(str, ": "); } - if (highlight) write_warn(str, bold); - if (!NIL_P(emesg)) { einfo = RSTRING_PTR(emesg); elen = RSTRING_LEN(emesg); diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index c69d18b0c9..713a59df70 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1407,6 +1407,9 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| message = e.full_message(highlight: true) assert_match(/\e/, message) + assert_not_match(/(\e\[1)m\1/, message) + e2 = assert_raise(RuntimeError) {raise RuntimeError, "", bt} + assert_not_match(/(\e\[1)m\1/, e2.full_message(highlight: true)) message = e.full_message if Exception.to_tty? |