summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-08-16 22:25:31 +0900
committeraycabta <aycabta@gmail.com>2020-08-18 14:38:02 +0900
commit43c648c8325db536715a8e827951ac48114eb6bd (patch)
tree0a7125760975e4a898e4fc25ff45853821b9fad0 /test
parentb3f84b4a5b7c78339c28baa11f75ed4c121bd5ca (diff)
[ruby/irb] Support shortening lambda notation
https://github.com/ruby/irb/commit/8e3f81d428
Diffstat (limited to 'test')
-rw-r--r--test/irb/test_ruby_lex.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb
index db15593f37..51a0bd1351 100644
--- a/test/irb/test_ruby_lex.rb
+++ b/test/irb/test_ruby_lex.rb
@@ -234,5 +234,21 @@ module TestIRB
assert_indenting(lines, row.new_line_spaces, true)
end
end
+
+ def test_tlambda
+ input_with_correct_indents = [
+ Row.new(%q(if true), nil, 2),
+ Row.new(%q( -> {), nil, 4),
+ Row.new(%q( }), 2, 2),
+ Row.new(%q(end), 0, 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
end
end