summaryrefslogtreecommitdiffhomepage
path: root/test/file.rb
diff options
context:
space:
mode:
authorPaolo Bosetti <[email protected]>2013-10-02 13:05:12 +0200
committerPaolo Bosetti <[email protected]>2013-10-02 13:05:12 +0200
commitc608c26ab47eb226cfed310c4cf16ed31be7fa0d (patch)
tree8a7027459758c8bdb98cdb85a60e68af9d99808d /test/file.rb
parent49494a736733e94b88e20b2b2fe9769c90862b5a (diff)
parent8b48e2b4a42c9e1c697f94d3bb362a12484fe2e7 (diff)
downloadmruby-c608c26ab47eb226cfed310c4cf16ed31be7fa0d.tar.gz
mruby-c608c26ab47eb226cfed310c4cf16ed31be7fa0d.zip
Merge branch 'master' of https://github.com/iij/mruby-io
Diffstat (limited to 'test/file.rb')
-rw-r--r--test/file.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/file.rb b/test/file.rb
index 8fe7636e0..4b3458d1a 100644
--- a/test/file.rb
+++ b/test/file.rb
@@ -49,6 +49,17 @@ assert('File.extname') do
assert_equal '', File.extname('.foo')
end
+assert('IO#flock') do
+ f = File.open $mrbtest_io_rfname
+ assert_equal(f.flock(File::LOCK_SH), 0)
+ assert_equal(f.flock(File::LOCK_UN), 0)
+ assert_equal(f.flock(File::LOCK_EX | File::LOCK_UN), 0)
+ assert_equal(f.flock(File::LOCK_UN), 0)
+ f.close
+ true
+end
+
+
assert('File.size') do
File.size($mrbtest_io_rfname) == $mrbtest_io_msg.size + 1 and
File.size($mrbtest_io_wfname) == 0