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:
parent
c72a2fad97
commit
4268084d69
1 changed files with 26 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue