diff options
author | aycabta <aycabta@gmail.com> | 2020-06-01 08:53:07 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-07-22 02:31:46 +0900 |
commit | 78ccab25306d15c325baa0761d9505ac23956f22 (patch) | |
tree | ac463593c2efd8e924e43cea302d154e680ed0a6 /test | |
parent | 48eb1ad2c3aa1a14bd8ef61cbd72a791b0b67418 (diff) | |
download | ruby-78ccab25306d15c325baa0761d9505ac23956f22.tar.gz |
[ruby/irb] Suppress incomplete coding magic comment error
https://github.com/ruby/irb/commit/6a457edbd1
Diffstat (limited to 'test')
-rw-r--r-- | test/irb/test_ruby_lex.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb index dd5a1f7ca5..367d1e204a 100644 --- a/test/irb/test_ruby_lex.rb +++ b/test/irb/test_ruby_lex.rb @@ -126,5 +126,18 @@ module TestIRB assert_indenting(lines, row.new_line_spaces, true) end end + + def test_incomplete_coding_magic_comment + input_with_correct_indents = [ + Row.new(%q(#coding:u), 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 end end |