diff options
author | aycabta <aycabta@gmail.com> | 2020-08-16 22:25:31 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-08-18 14:38:02 +0900 |
commit | 43c648c8325db536715a8e827951ac48114eb6bd (patch) | |
tree | 0a7125760975e4a898e4fc25ff45853821b9fad0 /test | |
parent | b3f84b4a5b7c78339c28baa11f75ed4c121bd5ca (diff) | |
download | ruby-43c648c8325db536715a8e827951ac48114eb6bd.tar.gz |
[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.rb | 16 |
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 |