summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Oliver Nutter <headius@headius.com>2019-08-29 16:15:45 -0500
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2019-08-30 06:58:29 +0900
commit0a9d74f8cf1c01300d0396ce3cb4da81d3652d5a (patch)
treee54d9dc53d00322fa1bc5f6bb56550ecc3e3210b
parentbdc36094e3e11c045b26b2831a3a7e69b937ec61 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2412
-rw-r--r--test/ruby/test_io.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 247e4a7607..b47db4f3c2 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -3813,28 +3813,28 @@ __END__
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_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_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'