diff options
author | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-09 08:49:09 +0000 |
---|---|---|
committer | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-09 08:49:09 +0000 |
commit | 842b735979f41169900af88a50e24d0d5e698a44 (patch) | |
tree | 5833eef0f25afb31e6be33e98e660f42f42ff600 /test | |
parent | 236e2993ef7667912f8dfb1b1de2d1d60a82127d (diff) | |
download | ruby-842b735979f41169900af88a50e24d0d5e698a44.tar.gz |
add 'x' mode character for O_EXCL
[Feature #11258]
Patch by cremno (cremno phobia)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index a1462c53b2..ea1dfc758c 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -3555,6 +3555,14 @@ __END__ end end if File::BINARY != 0 + def test_exclusive_mode + make_tempfile do |t| + assert_raise(Errno::EEXIST){ open(t.path, 'wx'){} } + assert_raise(ArgumentError){ open(t.path, 'rx'){} } + assert_raise(ArgumentError){ open(t.path, 'ax'){} } + end + end + def test_race_gets_and_close assert_separately([], "#{<<-"begin;"}\n#{<<-"end;"}") bug13076 = '[ruby-core:78845] [Bug #13076]' |