* test/ruby/test_io.rb: skip false tests on Windows.
[ruby-core:29886] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
63324cb36d
commit
b36b3067f0
@ -1,3 +1,8 @@
|
|||||||
|
Sat May 1 00:14:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* test/ruby/test_io.rb: skip false tests on Windows.
|
||||||
|
[ruby-core:29886]
|
||||||
|
|
||||||
Fri Apr 30 22:46:27 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
Fri Apr 30 22:46:27 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||||
|
|
||||||
* math.c: Math::DomainError < StandardException [ruby-core:29855]
|
* math.c: Math::DomainError < StandardException [ruby-core:29855]
|
||||||
|
@ -19,7 +19,7 @@ class TestIO < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def have_nonblock?
|
def have_nonblock?
|
||||||
IO.instance_methods.index(:"nonblock=")
|
IO.method_defined?("nonblock=")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_pipe
|
def test_pipe
|
||||||
@ -113,7 +113,8 @@ class TestIO < Test::Unit::TestCase
|
|||||||
def test_ungetc
|
def test_ungetc
|
||||||
r, w = IO.pipe
|
r, w = IO.pipe
|
||||||
w.close
|
w.close
|
||||||
assert_raise(IOError, "[ruby-dev:31650]") { 20000.times { r.ungetc "a" } }
|
s = "a" * 1000
|
||||||
|
assert_raise(IOError, "[ruby-dev:31650]") { 200.times { r.ungetc s } }
|
||||||
ensure
|
ensure
|
||||||
r.close
|
r.close
|
||||||
end
|
end
|
||||||
@ -161,8 +162,11 @@ class TestIO < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_rubydev33072
|
def test_rubydev33072
|
||||||
|
t = make_tempfile
|
||||||
|
path = t.path
|
||||||
|
t.close!
|
||||||
assert_raise(Errno::ENOENT, "[ruby-dev:33072]") do
|
assert_raise(Errno::ENOENT, "[ruby-dev:33072]") do
|
||||||
File.read("empty", nil, nil, {})
|
File.read(path, nil, nil, {})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -328,7 +332,12 @@ class TestIO < Test::Unit::TestCase
|
|||||||
with_read_pipe("abc") {|r1|
|
with_read_pipe("abc") {|r1|
|
||||||
assert_equal("a", r1.getc)
|
assert_equal("a", r1.getc)
|
||||||
with_pipe {|r2, w2|
|
with_pipe {|r2, w2|
|
||||||
|
begin
|
||||||
w2.nonblock = true
|
w2.nonblock = true
|
||||||
|
rescue Errno::EBADF
|
||||||
|
skip "nonblocking IO for pipe is not implemented"
|
||||||
|
break
|
||||||
|
end
|
||||||
s = w2.syswrite("a" * 100000)
|
s = w2.syswrite("a" * 100000)
|
||||||
t = Thread.new { sleep 0.1; r2.read }
|
t = Thread.new { sleep 0.1; r2.read }
|
||||||
ret = IO.copy_stream(r1, w2)
|
ret = IO.copy_stream(r1, w2)
|
||||||
@ -382,10 +391,14 @@ class TestIO < Test::Unit::TestCase
|
|||||||
if have_nonblock?
|
if have_nonblock?
|
||||||
with_pipe {|r1, w1|
|
with_pipe {|r1, w1|
|
||||||
with_pipe {|r2, w2|
|
with_pipe {|r2, w2|
|
||||||
t1 = Thread.new { w1 << megacontent; w1.close }
|
begin
|
||||||
t2 = Thread.new { r2.read }
|
|
||||||
r1.nonblock = true
|
r1.nonblock = true
|
||||||
w2.nonblock = true
|
w2.nonblock = true
|
||||||
|
rescue Errno::EBADF
|
||||||
|
skip "nonblocking IO for pipe is not implemented"
|
||||||
|
end
|
||||||
|
t1 = Thread.new { w1 << megacontent; w1.close }
|
||||||
|
t2 = Thread.new { r2.read }
|
||||||
ret = IO.copy_stream(r1, w2)
|
ret = IO.copy_stream(r1, w2)
|
||||||
assert_equal(megacontent.bytesize, ret)
|
assert_equal(megacontent.bytesize, ret)
|
||||||
w2.close
|
w2.close
|
||||||
@ -512,8 +525,12 @@ class TestIO < Test::Unit::TestCase
|
|||||||
|
|
||||||
if have_nonblock?
|
if have_nonblock?
|
||||||
with_socketpair {|s1, s2|
|
with_socketpair {|s1, s2|
|
||||||
t = Thread.new { s2.read }
|
begin
|
||||||
s1.nonblock = true
|
s1.nonblock = true
|
||||||
|
rescue Errno::EBADF
|
||||||
|
skip "nonblocking IO for pipe is not implemented"
|
||||||
|
end
|
||||||
|
t = Thread.new { s2.read }
|
||||||
ret = IO.copy_stream("megasrc", s1)
|
ret = IO.copy_stream("megasrc", s1)
|
||||||
assert_equal(megacontent.bytesize, ret)
|
assert_equal(megacontent.bytesize, ret)
|
||||||
s1.close
|
s1.close
|
||||||
@ -892,6 +909,7 @@ class TestIO < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_read_nonblock_error
|
def test_read_nonblock_error
|
||||||
return if !have_nonblock?
|
return if !have_nonblock?
|
||||||
|
skip "IO#read_nonblock is not supported on file/pipe." if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
|
||||||
with_pipe {|r, w|
|
with_pipe {|r, w|
|
||||||
begin
|
begin
|
||||||
r.read_nonblock 4096
|
r.read_nonblock 4096
|
||||||
@ -903,6 +921,7 @@ class TestIO < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_write_nonblock_error
|
def test_write_nonblock_error
|
||||||
return if !have_nonblock?
|
return if !have_nonblock?
|
||||||
|
skip "IO#write_nonblock is not supported on file/pipe." if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
|
||||||
with_pipe {|r, w|
|
with_pipe {|r, w|
|
||||||
begin
|
begin
|
||||||
loop {
|
loop {
|
||||||
@ -1498,19 +1517,24 @@ End
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_initialize
|
def test_initialize
|
||||||
|
return unless defined?(Fcntl::F_GETFL)
|
||||||
|
|
||||||
t = make_tempfile
|
t = make_tempfile
|
||||||
|
|
||||||
fd = IO.sysopen(t.path, "w")
|
fd = IO.sysopen(t.path, "w")
|
||||||
assert_kind_of(Integer, fd)
|
assert_kind_of(Integer, fd)
|
||||||
%w[r r+ w+ a+].each do |mode|
|
%w[r r+ w+ a+].each do |mode|
|
||||||
assert_raise(Errno::EINVAL, '[ruby-dev:38571]') {IO.new(fd, mode)}
|
assert_raise(Errno::EINVAL, "#{mode} [ruby-dev:38571]") {IO.new(fd, mode)}
|
||||||
end
|
end
|
||||||
f = IO.new(fd, "w")
|
f = IO.new(fd, "w")
|
||||||
f.write("FOO\n")
|
f.write("FOO\n")
|
||||||
f.close
|
f.close
|
||||||
|
|
||||||
assert_equal("FOO\n", File.read(t.path))
|
assert_equal("FOO\n", File.read(t.path))
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_reinitialize
|
||||||
|
t = make_tempfile
|
||||||
f = open(t.path)
|
f = open(t.path)
|
||||||
assert_raise(RuntimeError) do
|
assert_raise(RuntimeError) do
|
||||||
f.instance_eval { initialize }
|
f.instance_eval { initialize }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#define RUBY_VERSION "1.9.2"
|
#define RUBY_VERSION "1.9.2"
|
||||||
#define RUBY_RELEASE_DATE "2010-04-30"
|
#define RUBY_RELEASE_DATE "2010-05-01"
|
||||||
#define RUBY_PATCHLEVEL -1
|
#define RUBY_PATCHLEVEL -1
|
||||||
#define RUBY_BRANCH_NAME "trunk"
|
#define RUBY_BRANCH_NAME "trunk"
|
||||||
|
|
||||||
@ -7,8 +7,8 @@
|
|||||||
#define RUBY_VERSION_MINOR 9
|
#define RUBY_VERSION_MINOR 9
|
||||||
#define RUBY_VERSION_TEENY 1
|
#define RUBY_VERSION_TEENY 1
|
||||||
#define RUBY_RELEASE_YEAR 2010
|
#define RUBY_RELEASE_YEAR 2010
|
||||||
#define RUBY_RELEASE_MONTH 4
|
#define RUBY_RELEASE_MONTH 5
|
||||||
#define RUBY_RELEASE_DAY 30
|
#define RUBY_RELEASE_DAY 1
|
||||||
|
|
||||||
#include "ruby/version.h"
|
#include "ruby/version.h"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user