From f085a6fb6953a23e555cae7ffe4274927c6b0961 Mon Sep 17 00:00:00 2001 From: aycabta Date: Wed, 8 Sep 2021 22:19:52 +0900 Subject: [ruby/irb] Support symbol with backtick https://github.com/ruby/irb/commit/0aa2425883 --- test/irb/test_ruby_lex.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test') diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb index d31d38dc99..e255720e25 100644 --- a/test/irb/test_ruby_lex.rb +++ b/test/irb/test_ruby_lex.rb @@ -136,6 +136,26 @@ module TestIRB end end + def test_symbols + input_with_correct_indents = [ + Row.new(%q(:a), nil, 0), + Row.new(%q(:A), nil, 0), + Row.new(%q(:+), nil, 0), + Row.new(%q(:@@a), nil, 0), + Row.new(%q(:@a), nil, 0), + Row.new(%q(:$a), nil, 0), + Row.new(%q(:def), nil, 0), + Row.new(%q(:`), nil, 0), + ] + + lines = [] + input_with_correct_indents.each do |row| + lines << row.content + assert_indenting(lines, row.current_line_spaces, false) + assert_indenting(lines, row.new_line_spaces, true) + end + end + def test_endless_range_at_end_of_line if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.6.0') pend 'Endless range is available in 2.6.0 or later' -- cgit v1.2.3