about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-05-12 18:59:44 -0700
committerEric Wong <normalperson@yhbt.net>2011-05-12 18:59:44 -0700
commit83bdc390d98e9af4439c6db92679a9a84eb9f52a (patch)
treeca35df27932b4b88e716332c8bab39cbfb717af0
parentec812c7f2d83681b7beecdf21334e3a43c2b7090 (diff)
downloadruby_io_splice-83bdc390d98e9af4439c6db92679a9a84eb9f52a.tar.gz
And enable UNIX socket tests for this
-rw-r--r--test/test_copy_stream.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/test_copy_stream.rb b/test/test_copy_stream.rb
index 1858257..71d7cae 100644
--- a/test/test_copy_stream.rb
+++ b/test/test_copy_stream.rb
@@ -232,7 +232,6 @@ class TestIOCopyStreamCompat < Test::Unit::TestCase
   end
 
   def test_copy_stream_socket
-    return
     mkcdtmpdir {
 
       content = "foobar"
@@ -280,13 +279,13 @@ class TestIOCopyStreamCompat < Test::Unit::TestCase
       }
 
       File.open("bigsrc") {|f|
-        assert_equal(bigcontent[0,100], f.read(100))
+        assert_equal(bigcontent[0,100], f.sysread(100))
         assert_equal(100, f.pos)
         with_socketpair {|s1, s2|
           t = Thread.new { s2.read }
           ret = IO::Splice.copy_stream(f, s1)
           assert_equal(bigcontent.bytesize-100, ret)
-          assert_equal(bigcontent.length, f.pos)
+          assert_equal(bigcontent.length, f.sysseek(0, IO::SEEK_CUR))
           s1.close
           result = t.value
           assert_equal(bigcontent[100..-1], result)