summaryrefslogtreecommitdiff
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r--test/ruby/test_io.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 3550162aa9..2fd4f77f40 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1085,6 +1085,21 @@ class TestIO < Test::Unit::TestCase
end
end
+ def test_pos
+ t = make_tempfile
+
+ open(t.path, IO::RDWR|IO::CREAT|IO::TRUNC, 0600) do |f|
+ f.write "Hello"
+ assert_equal(5, f.pos)
+ end
+ open(t.path, IO::RDWR|IO::CREAT|IO::TRUNC, 0600) do |f|
+ f.sync = true
+ f.read
+ f.write "Hello"
+ assert_equal(5, f.pos)
+ end
+ end
+
def test_sysseek
t = make_tempfile