mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Move pread + pwrite tests out of RUBY_ENGINE block
These tests were guarded by a RUBY_ENGINE of "ruby" even though they test an official Ruby feature (pread/pwrite added in Ruby 2.5). This commit moves them to the top level of the test case so they will run on other implementations.
This commit is contained in:
parent
bdc36094e3
commit
0a9d74f8cf
Notes:
git
2019-08-31 04:40:14 +09:00
1 changed files with 21 additions and 21 deletions
|
@ -3813,29 +3813,29 @@ __END__
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_pread
|
||||
make_tempfile { |t|
|
||||
open(t.path) do |f|
|
||||
assert_equal("bar", f.pread(3, 4))
|
||||
buf = "asdf"
|
||||
assert_equal("bar", f.pread(3, 4, buf))
|
||||
assert_equal("bar", buf)
|
||||
assert_raise(EOFError) { f.pread(1, f.size) }
|
||||
end
|
||||
}
|
||||
end if IO.method_defined?(:pread)
|
||||
|
||||
def test_pwrite
|
||||
make_tempfile { |t|
|
||||
open(t.path, IO::RDWR) do |f|
|
||||
assert_equal(3, f.pwrite("ooo", 4))
|
||||
assert_equal("ooo", f.pread(3, 4))
|
||||
end
|
||||
}
|
||||
end if IO.method_defined?(:pread) and IO.method_defined?(:pwrite)
|
||||
end
|
||||
|
||||
def test_pread
|
||||
make_tempfile { |t|
|
||||
open(t.path) do |f|
|
||||
assert_equal("bar", f.pread(3, 4))
|
||||
buf = "asdf"
|
||||
assert_equal("bar", f.pread(3, 4, buf))
|
||||
assert_equal("bar", buf)
|
||||
assert_raise(EOFError) { f.pread(1, f.size) }
|
||||
end
|
||||
}
|
||||
end if IO.method_defined?(:pread)
|
||||
|
||||
def test_pwrite
|
||||
make_tempfile { |t|
|
||||
open(t.path, IO::RDWR) do |f|
|
||||
assert_equal(3, f.pwrite("ooo", 4))
|
||||
assert_equal("ooo", f.pread(3, 4))
|
||||
end
|
||||
}
|
||||
end if IO.method_defined?(:pread) and IO.method_defined?(:pwrite)
|
||||
|
||||
def test_select_exceptfds
|
||||
if Etc.uname[:sysname] == 'SunOS' && Etc.uname[:release] == '5.11'
|
||||
skip "Solaris 11 fails this"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue