summaryrefslogtreecommitdiff
path: root/test/irb
diff options
context:
space:
mode:
authorNobuhiro IMAI <nov@yo.rim.or.jp>2020-12-29 16:07:20 +0900
committerGitHub <noreply@github.com>2020-12-28 23:07:20 -0800
commit9b7ceb676540d0061b2a31fee2da84ae31f93bae (patch)
treeff0a7e1eb66f51f41ad3d2a612eb636a1d72e106 /test/irb
parentc0a2d322c692228a7574c39c7e173da4af0f34ea (diff)
irb: add more syntax errors colorizing support (#3967)
Notes
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'test/irb')
-rw-r--r--test/irb/test_color.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb
index 03c4ab74a8..c0682b1bbf 100644
--- a/test/irb/test_color.rb
+++ b/test/irb/test_color.rb
@@ -82,9 +82,23 @@ module TestIRB
tests.merge!({
"[1]]]\u0013" => "[#{BLUE}#{BOLD}1#{CLEAR}]#{RED}#{REVERSE}]#{CLEAR}#{RED}#{REVERSE}]#{CLEAR}#{RED}#{REVERSE}^S#{CLEAR}",
})
+ tests.merge!({
+ "def req(true) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{RED}#{REVERSE}true#{CLEAR}) #{RED}#{REVERSE}end#{CLEAR}",
+ "nil = 1" => "#{RED}#{REVERSE}nil#{CLEAR} = #{BLUE}#{BOLD}1#{CLEAR}",
+ "alias $x $1" => "#{GREEN}alias#{CLEAR} #{GREEN}#{BOLD}$x#{CLEAR} #{RED}#{REVERSE}$1#{CLEAR}",
+ "class bad; end" => "#{GREEN}class#{CLEAR} #{RED}#{REVERSE}bad#{CLEAR}; #{GREEN}end#{CLEAR}",
+ "def req(@a) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(#{RED}#{REVERSE}@a#{CLEAR}) #{GREEN}end#{CLEAR}",
+ })
else
tests.merge!({
"[1]]]\u0013" => "[1]]]^S",
+ })
+ tests.merge!({
+ "def req(true) end" => "def req(true) end",
+ "nil = 1" => "#{CYAN}#{BOLD}nil#{CLEAR} = #{BLUE}#{BOLD}1#{CLEAR}",
+ "alias $x $1" => "#{GREEN}alias#{CLEAR} #{GREEN}#{BOLD}$x#{CLEAR} $1",
+ "class bad; end" => "#{GREEN}class#{CLEAR} bad; #{GREEN}end#{CLEAR}",
+ "def req(@a) end" => "#{GREEN}def#{CLEAR} #{BLUE}#{BOLD}req#{CLEAR}(@a) #{GREEN}end#{CLEAR}",
})
end