[前][次][番号順一覧][スレッド一覧]

ruby-changes:56562

From: Nobuyoshi <ko1@a...>
Date: Mon, 15 Jul 2019 19:40:15 +0900 (JST)
Subject: [ruby-changes:56562] Nobuyoshi Nakada: 0c6c937904 (master): Removed duplicate highlighting

https://git.ruby-lang.org/ruby.git/commit/?id=0c6c937904

From 0c6c937904aafc1809386bd892a2d114d22d01fe Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 15 Jul 2019 19:31:48 +0900
Subject: Removed duplicate highlighting


diff --git a/eval_error.c b/eval_error.c
index 6132cbe..17c0e86 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 https://github.com/ruby/ruby/blob/trunk/eval_error.c#L144
 	    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 c69d18b..713a59d 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| https://github.com/ruby/ruby/blob/trunk/test/ruby/test_exception.rb#L1407
 
     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?
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]