about summary refs log tree commit homepage
path: root/test/test_cfr.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_cfr.rb')
-rw-r--r--test/test_cfr.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/test_cfr.rb b/test/test_cfr.rb
index 3483c5a..0775c0f 100644
--- a/test/test_cfr.rb
+++ b/test/test_cfr.rb
@@ -13,7 +13,7 @@ class TestCfr < Test::Unit::TestCase
     assert_equal 5, src.syswrite(str)
     src.sysseek(0)
     begin
-      nr = SleepyPenguin.copy_file_range(src, nil, dst, nil, size, 0)
+      nr = SleepyPenguin.copy_file_range(src, dst, size)
     rescue Errno::EINVAL
       warn 'copy_file_range not supported (requires Linux 4.5+)'
       warn "We have: #{`uname -a`}"
@@ -22,6 +22,14 @@ class TestCfr < Test::Unit::TestCase
     assert_equal nr, 5
     dst.sysseek(0)
     assert_equal str, dst.sysread(5)
+
+    nr = SleepyPenguin.copy_file_range(src, dst, size, off_in: 1, off_out: 0)
+    assert_equal 4, nr
+    dst.sysseek(0)
+    assert_equal 'bcde', dst.sysread(4)
+
+    nr = SleepyPenguin.copy_file_range(src, dst, size, off_in: 9)
+    assert_equal 0, nr, 'no EOFError'
   ensure
     dst.close!
     src.close!