summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-06 01:06:57 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-06 01:06:57 +0000
commit127cfd117400b84ff5ab9102f6c9a57895c375b5 (patch)
treed7d2cf6f7d6358852ffcf503f11d8270ab21aff7 /test
parent61337683b38fa28490b9d209ee3e8821f6a77050 (diff)
* io.c (rb_io_s_binwrite): use mode "r+b" instead of "ab" to handle
offset correctly. [ruby-core:28517] * test/ruby/test_io.rb: use assert_equal instead of assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 6ea128a880..cab270d447 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1518,13 +1518,13 @@ End
path = t.path
t.close(false)
File.write(path, "foo\nbar\nbaz")
- assert("foo\nbar\nbaz", File.read(path))
+ assert_equal("foo\nbar\nbaz", File.read(path))
File.write(path, "FOO", 0)
- assert("FOO\nbar\nbaz", File.read(path))
+ assert_equal("FOO\nbar\nbaz", File.read(path))
File.write(path, "BAR")
- assert("BAR", File.read(path))
+ assert_equal("BAR", File.read(path))
File.write(path, "\u{3042}", mode: "w", encoding: "EUC-JP")
- assert("\u{3042}".encode("EUC-JP"), File.read(path, encoding: "EUC-JP"))
+ assert_equal("\u{3042}".encode("EUC-JP"), File.read(path, encoding: "EUC-JP"))
t.unlink
end
@@ -1533,13 +1533,13 @@ End
path = t.path
t.close(false)
File.binwrite(path, "foo\nbar\nbaz")
- assert("foo\nbar\nbaz", File.read(path))
+ assert_equal("foo\nbar\nbaz", File.read(path))
File.binwrite(path, "FOO", 0)
- assert("FOO\nbar\nbaz", File.read(path))
+ assert_equal("FOO\nbar\nbaz", File.read(path))
File.binwrite(path, "BAR")
- assert("BAR", File.read(path))
+ assert_equal("BAR", File.read(path))
File.binwrite(path, "\u{3042}")
- assert("\u{3042}", File.read(path, encoding: "EUC-JP"))
+ assert_equal("\u{3042}", File.read(path))
t.unlink
end
end