* test/ruby/test_io_m17n.rb (test_write_noenc): don't mix text and
binary mode. [ruby-dev:32743] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3410fd6812
commit
f3945617bd
@ -1,3 +1,8 @@
|
|||||||
|
Tue Dec 25 13:23:13 2007 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* test/ruby/test_io_m17n.rb (test_write_noenc): don't mix text and
|
||||||
|
binary mode. [ruby-dev:32743]
|
||||||
|
|
||||||
Tue Dec 25 13:13:09 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Dec 25 13:13:09 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* README.EXT.ja, dir.c, eval.c, eval_intern.h, lex.c.src,
|
* README.EXT.ja, dir.c, eval.c, eval_intern.h, lex.c.src,
|
||||||
|
@ -300,14 +300,14 @@ EOT
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_write_noenc
|
def test_write_noenc
|
||||||
src = "\xc2\xa1\n"
|
src = "\xc2\xa1\n".force_encoding("ascii-8bit")
|
||||||
with_tmpdir {
|
with_tmpdir {
|
||||||
open('tmp', "w") {|f|
|
open('tmp', "w") {|f|
|
||||||
ENCS.each {|enc|
|
ENCS.each {|enc|
|
||||||
f.write src.dup.force_encoding(enc)
|
f.write src.dup.force_encoding(enc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
open('tmp', 'rb') {|f|
|
open('tmp', 'r:ascii-8bit') {|f|
|
||||||
assert_equal(src*ENCS.length, f.read)
|
assert_equal(src*ENCS.length, f.read)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user