@@ -598,6 +598,29 @@ def test_local_variables_dependent_code
598598 assert_code_block_open ( lines , false , local_variables : [ 'a' ] )
599599 end
600600
601+ def test_embdoc_indent
602+ input_with_correct_indents = [
603+ Row . new ( %q(=begin) , 0 , 0 , 0 ) ,
604+ Row . new ( %q(a) , 0 , 0 , 0 ) ,
605+ Row . new ( %q( b) , 1 , 1 , 0 ) ,
606+ Row . new ( %q(=end) , 0 , 0 , 0 ) ,
607+ Row . new ( %q(if 1) , 0 , 2 , 1 ) ,
608+ Row . new ( %q( 2) , 2 , 2 , 1 ) ,
609+ Row . new ( %q(=begin) , 0 , 0 , 1 ) ,
610+ Row . new ( %q(a) , 0 , 0 , 1 ) ,
611+ Row . new ( %q( b) , 1 , 1 , 1 ) ,
612+ Row . new ( %q(=end) , 0 , 2 , 1 ) ,
613+ Row . new ( %q( 3) , 2 , 2 , 1 ) ,
614+ Row . new ( %q(end) , 0 , 0 , 0 ) ,
615+ ]
616+ lines = [ ]
617+ input_with_correct_indents . each do |row |
618+ lines << row . content
619+ assert_row_indenting ( lines , row )
620+ assert_nesting_level ( lines , row . nesting_level )
621+ end
622+ end
623+
601624 def test_heredoc_with_indent
602625 if Gem ::Version . new ( RUBY_VERSION ) < Gem ::Version . new ( '2.7.0' )
603626 pend 'This test needs Ripper::Lexer#scan to take broken tokens'
0 commit comments