1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/irb] Add encoding magic comments of editors

https://github.com/ruby/irb/commit/f8c10ea24b
This commit is contained in:
aycabta 2020-06-09 00:10:14 +09:00
parent c72a2fad97
commit 4268084d69

View file

@ -152,5 +152,31 @@ module TestIRB
assert_indenting(lines, row.new_line_spaces, true)
end
end
def test_incomplete_emacs_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
def test_incomplete_vim_coding_magic_comment
input_with_correct_indents = [
Row.new(%q(# vim:set fileencoding=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