mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_io_m17n.rb (test_strip_bom): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c51a968903
commit
cb7075a6a2
2 changed files with 18 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
Sat Jul 11 14:43:34 2009 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* test/ruby/test_io_m17n.rb (test_strip_bom): added.
|
||||
|
||||
Sat Jul 11 07:11:59 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/readline/readline.c (readline_attempted_completion_function):
|
||||
|
|
|
@ -1691,5 +1691,19 @@ EOT
|
|||
assert_equal("\"丂\"".force_encoding("ascii-8bit"), content)
|
||||
}
|
||||
end
|
||||
|
||||
def test_strip_bom
|
||||
with_tmpdir {
|
||||
text = "\uFEFFa"
|
||||
%w/UTF-8 UTF-16BE UTF-16LE UTF-32BE UTF-32LE/.each do |name|
|
||||
path = '%s-bom.txt' % name
|
||||
content = text.encode(name)
|
||||
generate_file(path, content)
|
||||
result = File.read(path, mode: 'rb:utf-7-bom')
|
||||
assert_equal(content[1].force_encoding("ascii-8bit"),
|
||||
result.force_encoding("ascii-8bit"))
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue