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

ruby-changes:55975

From: Takashi <ko1@a...>
Date: Tue, 4 Jun 2019 00:30:44 +0900 (JST)
Subject: [ruby-changes:55975] Takashi Kokubun: d21a694075 (trunk): Improve test_color to prevent regression

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

From d21a694075866f4a3333cf65910a649acd057306 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Tue, 4 Jun 2019 00:29:53 +0900
Subject: Improve test_color to prevent regression

Actually de541fe1961370e64541d73c96cf790d30f28604 was still needed.
This commit would improve the test coverage using the branch.

diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb
index ae6e02a..7a12829 100644
--- a/test/irb/test_color.rb
+++ b/test/irb/test_color.rb
@@ -40,7 +40,7 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_color.rb#L40
         '/r#{e}g/' => "#{RED}#{BOLD}/#{CLEAR}#{RED}r#{CLEAR}#{RED}\#{#{CLEAR}e#{RED}}#{CLEAR}#{RED}g#{CLEAR}#{RED}#{BOLD}/#{CLEAR}",
         "'a\nb'" => "#{RED}'#{CLEAR}#{RED}a#{CLEAR}\n#{RED}b#{CLEAR}#{RED}'#{CLEAR}",
         "4.5.6" => "#{MAGENTA}#{BOLD}4.5#{CLEAR}#{RED}#{REVERSE}.6#{CLEAR}",
-        "[1]]]" => "[1]]]",
+        "[1]]]\u0013" => "[1]]]^S",
         "\e[0m\n" => "#{RED}#{REVERSE}^[#{CLEAR}[#{BLUE}#{BOLD}0#{CLEAR}m\n",
         "%w[a b]" => "#{RED}%w[#{CLEAR}#{RED}a#{CLEAR} #{RED}b#{CLEAR}#{RED}]#{CLEAR}",
         "%i[c d]" => "#{RED}%i[#{CLEAR}#{RED}c#{CLEAR} #{RED}d#{CLEAR}#{RED}]#{CLEAR}",
@@ -69,7 +69,6 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_color.rb#L69
         "\t" => "\t", # not ^I
         "foo(*%W(bar))" => "foo(*#{RED}%W(#{CLEAR}#{RED}bar#{CLEAR}#{RED})#{CLEAR})",
         "$stdout" => "#{GREEN}#{BOLD}$stdout#{CLEAR}",
-        "\u0013" => "#{RED}#{REVERSE}^S#{CLEAR}",
       }.each do |code, result|
         actual = with_term { IRB::Color.colorize_code(code, complete: true) }
         assert_equal(result, actual, "Case: colorize_code(#{code.dump}, complete: true)\nResult: #{humanized_literal(actual)}")
-- 
cgit v0.10.2


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

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