summaryrefslogtreecommitdiff
path: root/test/irb/test_ruby_lex.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/irb/test_ruby_lex.rb')
-rw-r--r--test/irb/test_ruby_lex.rb20
1 files changed, 20 insertions, 0 deletions
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'