aboutsummaryrefslogtreecommitdiffstats
path: root/test/irb
diff options
context:
space:
mode:
authorKaĆ­que Kandy Koga <kaiquekandykoga@gmail.com>2021-10-25 18:32:40 -0300
committergit <svn-admin@ruby-lang.org>2021-12-03 00:56:43 +0900
commit6b64e788234c19560070192927ae7b35b19b4587 (patch)
treee53651530421756a71250449bccf43e4affd8915 /test/irb
parentd486286f1d8fa01356498792b368c46fe9619d09 (diff)
downloadruby-6b64e788234c19560070192927ae7b35b19b4587.tar.gz
[ruby/irb] Examine indentation of in keyword when trying to type include
Use in_keyword_case_scope? Return fast https://github.com/ruby/irb/commit/8acc7f8dc7
Diffstat (limited to 'test/irb')
-rw-r--r--test/irb/test_ruby_lex.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb
index 32463f7fb6..47435d675e 100644
--- a/test/irb/test_ruby_lex.rb
+++ b/test/irb/test_ruby_lex.rb
@@ -399,6 +399,23 @@ module TestIRB
end
end
+ def test_corresponding_syntax_to_keyword_in
+ input_with_correct_indents = [
+ Row.new(%q(module E), nil, 2, 1),
+ Row.new(%q(end), 0, 0, 0),
+ Row.new(%q(class A), nil, 2, 1),
+ Row.new(%q( in), nil, 4, 1)
+ ]
+
+ 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)
+ assert_nesting_level(lines, row.nesting_level)
+ end
+ end
+
def test_bracket_corresponding_to_times
input_with_correct_indents = [
Row.new(%q(3.times { |i|), nil, 2, 1),