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

ruby-changes:60855

From: Nobuyoshi <ko1@a...>
Date: Tue, 21 Apr 2020 20:59:53 +0900 (JST)
Subject: [ruby-changes:60855] 3ef09c6e66 (master): eval_error.c: default nil as "reverse" is now false [Feature #8661]

https://git.ruby-lang.org/ruby.git/commit/?id=3ef09c6e66

From 3ef09c6e66cf28455536593af60a7c7072fb1777 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 21 Apr 2020 18:23:20 +0900
Subject: eval_error.c: default nil as "reverse" is now false  [Feature #8661]


diff --git a/eval_error.c b/eval_error.c
index 809d8ae..89e27af 100644
--- a/eval_error.c
+++ b/eval_error.c
@@ -309,9 +309,9 @@ rb_error_write(VALUE errinfo, VALUE emesg, VALUE errat, VALUE str, VALUE highlig https://github.com/ruby/ruby/blob/trunk/eval_error.c#L309
 	errat = Qnil;
     }
     eclass = CLASS_OF(errinfo);
-    if (NIL_P(reverse) || NIL_P(highlight)) {
+    if (NIL_P(reverse)) reverse = Qfalse;
+    if (NIL_P(highlight)) {
 	VALUE tty = (VALUE)rb_stderr_tty_p();
-	if (NIL_P(reverse)) reverse = tty;
 	if (NIL_P(highlight)) highlight = tty;
     }
     if (reverse) {
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 9d7ffd8..9529fc8 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -1156,13 +1156,11 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| https://github.com/ruby/ruby/blob/trunk/test/ruby/test_exception.rb#L1156
     if Exception.to_tty?
       assert_match(/\e/, message)
       message = message.gsub(/\e\[[\d;]*m/, '')
-      assert_operator(message, :start_with?, remark)
-      assert_operator(message, :end_with?, bottom)
     else
       assert_not_match(/\e/, message)
-      assert_operator(message, :start_with?, bottom)
-      assert_operator(message, :end_with?, top)
     end
+    assert_operator(message, :start_with?, bottom)
+    assert_operator(message, :end_with?, top)
   end
 
   def test_exception_in_message
-- 
cgit v0.10.2


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

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