summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_require.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-28 12:17:54 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-28 12:17:54 +0000
commita72401780b959e3a1143c05a703fd3522a1c483b (patch)
treed38b81bc1afb6fa3fc3795883a01becefa71f69a /test/ruby/test_require.rb
parent0d45b8a945767387e7465eb4b1411bf0c81ba587 (diff)
downloadruby-a72401780b959e3a1143c05a703fd3522a1c483b.tar.gz
ruby-a72401780b959e3a1143c05a703fd3522a1c483b.tar.xz
ruby-a72401780b959e3a1143c05a703fd3522a1c483b.zip
merge from trunk (r19984, r19985, r19991-r19998)
* io.c (extract_binmode): new function to extract binmode/textmode options from hash. * io.c (rb_io_extract_modeenc): use above function. * io.c (rb_io_s_pipe): recognize binmode/textmode options. * io.c (make_readconv): now can specify the size of cbuf. * io.c (read_all, appendline, io_getc, rb_io_ungetc): follow above change. * win32/win32.c (rb_w32_pipe_exec): internal fds should be always binmode. * test/ruby/test_file.rb (test_each_char_extended_file, test_getbyte_extended_file): add tests. * test/ruby/test_file.rb (test_*_extended_file): test in default/text/ binary mode. * test/ruby/test_file.rb (test_para_gets_extended_file): output file should be binmode. * test/ruby/test_io.rb (test_copy_stream, test_copy_stream_socket): skip some tests if there isn't IO#nonblock=. * test/ruby/test_io.rb (test_close_on_exec): skip if there isn't IO#close_on_exec=. * test/ruby/test_io.rb (test_bytes, test_readbyte): depend on binmode. * test/ruby/test_io.rb (test_sysopen): should specify the mode of IO::for_fd if F_GETFL is not available. * test/ruby/test_io_m17n.rb (test_getc_invalid3): should set binmode if enc is not compatible with ASCII. * test/ruby/test_require.rb (test_require_too_long_filename): too long commandline may be rejected by OS. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@19999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_require.rb')
-rw-r--r--test/ruby/test_require.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index a5f453a05..4048ba038 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -27,11 +27,15 @@ class TestRequire < Test::Unit::TestCase
end
INPUT
- assert_in_out_err(["-S", "foo/" * 10000 + "foo"], "") do |r, e|
- assert_equal([], r)
- assert_operator(2, :<=, e.size)
- assert_equal("openpath: pathname too long (ignored)", e.first)
- assert_match(/\(LoadError\)/, e.last)
+ begin
+ assert_in_out_err(["-S", "foo/" * 10000 + "foo"], "") do |r, e|
+ assert_equal([], r)
+ assert_operator(2, :<=, e.size)
+ assert_equal("openpath: pathname too long (ignored)", e.first)
+ assert_match(/\(LoadError\)/, e.last)
+ end
+ rescue Errno::EINVAL
+ # too long commandline may be blocked by OS.
end
end