aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_io.rb
Commit message (Collapse)AuthorAgeFilesLines
* io.c: convert arguments just oncenobu2016-07-071-0/+68
| | | | | | | * io.c (rb_io_s_foreach, rb_io_s_readlines): convert arguments just once before reading, instead of conversions for each lines. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb: Skip test_readpartial_with_not_empty_buffer,duerst2016-06-211-4/+4
| | | | | | | | | | | | test_read_buffer_error, test_read_unlocktmp_ensure, test_readpartial_unlocktmp_ensure, and test_sysread_unlocktmp_ensure on cygwin, because these tests repeatedly hang. This makes test_io.rb complete in finite time on cygwin. * ChangeLog: Fix test_in.rb -> test_io.rb (two instances). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_in.rb: Skip test_read_buffer_error on cygwin,duerst2016-06-211-1/+1
| | | | | | | because this test repeatedly hangs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_in.rb: Skip test_open_fifo_does_not_block_other_threadsduerst2016-06-201-1/+1
| | | | | | | | on cygwin. Fifos seem to work okay in cygwin, but this test repeatedly hangs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: suppress parser warningsnobu2016-02-191-4/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io.rb: test for rb_io_modestr_fmodenobu2015-12-301-0/+4
| | | | | | | | * test/stringio/test_io.rb (test_flag): add assertion for error when text and binary mode are mixed. [ruby-dev:49465] [Feature #11921] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* IO#readpartial rejects bad argsnormal2015-12-271-0/+11
| | | | | | | | | | | Sometimes a sleepy developer will want to swap read_nonblock for readpartial forget to remove "exception: false" * io.c (io_getpartial): remove unused kwarg from template * test/ruby/test_io.rb (test_readpartial_bad_args): new [Bug #11885] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb: handled rlimit value same as r52277hsbt2015-12-211-1/+4
| | | | | | [Bug #11852][ruby-dev:49446] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_io.rb: fix spelling errorsnormal2015-12-161-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io.rb: ignore not-implemented fadvicenobu2015-12-161-2/+6
| | | | | | | | * test/ruby/test_io.rb (test_advise_pipe): ignore not-implemented fadvice(2) when it is present but not implemented, as IO#advice does nothing and raises no exceptions. [Feature #11806] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* IO#advise should not raise Errno::ENOSYSnormal2015-12-111-4/+2
| | | | | | | | | | | | | | | As it is just a hint the kernel is free to ignore, IO#advise already succeeds when posix_fadvise is not available build time at all. Following that, if posix_fadvise was available at build time but not implemented in the running kernel, we should also ignore it. * io.c (do_io_advise): do not raise on ENOSYS * test/ruby/test_io.rb (test_advise): do not skip on Errno::ENOSYS (test_advise_pipe): ditto [ruby-core:72066] [Feature #11806] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io.rb: fix IO#advise on aarch64-linuxnobu2015-12-111-2/+4
| | | | | | | * test/ruby/test_io.rb (test_advise, test_advise_pipe): fadvise on aarch64-linux returns ESYS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* increase additional nfilesnaruse2015-11-261-1/+1
| | | | | | On recent my environment, it must be more than 11. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: try to_io firstnobu2015-11-251-0/+12
| | | | | | | * io.c (copy_stream_body): try to_io conversion before read, readpartial, and write methods. [ruby-dev:49008] [Bug #11199] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Old linux's default hard rlimit_nofile is 1024naruse2015-10-301-1/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use spawn's option to shorten the codenaruse2015-10-301-16/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb (ruby): check the existence of the constant instead ofusa2015-10-291-1/+1
| | | | | | | checking platform. see also r52277. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io.rb: assert_separatelynobu2015-10-251-27/+15
| | | | | | | * test/ruby/test_io.rb (test_dup_many, test_set_lineno): use assert_separately for more descriptive messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix conditions to setrlimitnobu2015-10-251-2/+4
| | | | | | | | | * test/ruby/test_io.rb (test_dup_many): limit FD only if possible. * test/ruby/test_process.rb (assert_fail_too_long_path): fix the condition for platform specific feature git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use rlimit_nproc other than Windowsnaruse2015-10-241-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* limit the number of FDs in a process for stress testnaruse2015-10-221-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb (TestIO#test_open_flag_binary): typo of method name ↵usa2015-07-291-4/+4
| | | | | | (test method itself, and calling method). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* open the path instead of tempfile objectnaruse2015-07-291-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_extract_modeenc): add option parameter `flags'naruse2015-07-291-0/+21
| | | | | | | to append extra oflags to normal mode. [Feature #11253] [ruby-core:69539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: reopen OS encoding pathnobu2015-06-301-0/+20
| | | | | | | | | * io.c (rb_io_reopen): freopen(3) with OS encoding path. [ruby-core:69780] [Bug #11320] * win32/file.c (rb_freopen): wrapper of wchar version freopen(3). use _wfreopen_s() if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io.rb: skip method definitionsnobu2015-06-301-2/+1
| | | | | | | * test/ruby/{test_io,test_io_m17n}.rb: skip method definitions on unsupported platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: reopen stdio streams correctly when given "w+"normal2015-06-291-0/+9
| | | | | | | | | | | * io.c (rb_io_oflags_modestr): handle O_TRUNC correctly * test/ruby/test_io.rb (test_reopen_stdio): new test Patch-by: cremno phobia <cremno@mail.ru> [ruby-core:69779] [Bug #11319] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb: add test for IO.binread fd leak.eregon2015-06-131-0/+4
| | | | | | See r50881. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/lib/envutil.rb (File.mkfifo): Defined using mkfifo command.akr2015-04-131-1/+1
| | | | | | | | | | | | * test/ruby/test_io.rb: Ditto. * test/ruby/test_file_exhaustive.rb: Use File.mkfifo. * test/ruby/test_process.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Test fifo without sleep.akr2015-04-121-5/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb: New test that open(fifo) doesn't block otherakr2015-04-121-0/+14
| | | | | | | threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: use read/write methods if possiblenobu2015-03-301-0/+15
| | | | | | | | * io.c (copy_stream_body): use the arguments without conversion if having read, readpartial, and write methods, than conversion by to_path method. [ruby-core:68676] [Bug #11015] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: don't raise after closenobu2015-03-131-0/+9
| | | | | | | * io.c (rb_io_close_read, rb_io_close_write): don't raise after close same as IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io.rb: separate platform-specific testsnobu2015-02-261-31/+13
| | | | | | | * test/ruby/test_io.rb: separate platform-specific tests at load time instead of runtime. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2015-01-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_close_m): Don't raise when the IO object is closed.akr2015-01-151-0/+13
| | | | | | | | [ruby-core:67444] [Feature #10718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb: added timeout for AIX environment.hsbt2015-01-051-1/+1
| | | | | | [ruby-core:62983][Bug #9917] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: preserve encodingsnobu2014-11-231-0/+8
| | | | | | | * io.c (must_respond_to): preserve encodings of variable name and class name in warning message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_io.rb: remove unnecessary begin/endnormal2014-11-161-18/+16
| | | | | | | | | | Unnecessary since r47422 when the "rescue IOError" clause was removed. * test/ruby/test_io.rb (test_readpartial_locktmp): remove unnecessary begin/end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/lib/envutil.rb: Moved from test/ruby/.akr2014-11-131-1/+0
| | | | | | | | | | | | | | * test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c, include/win32/win32.h (rb_w32_set_nonblock): newusa2014-11-101-10/+0
| | | | | | | | | | | | | | | | | | | | function to support nonblock-mode of pipes. * win32/win32.c (rb_w32_read): nonblock-mode pipe returns ERROR_NO_DATA if there is no data, but also returns it if remote-end is closed. * win32/win32.c (rb_w32_write): if cannot to write any data, it may be blocking. * io.c (rb_io_set_nonblock): use rb_w32_set_nonblock for Windows. * ext/io/nonblock/nonblock.c (rb_io_nonblock_set): use ruby's API when setting nonblock-mode. * test/ruby/test_io.rb: test nonblock pipes on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/envutil.rb (assert_join_threads): New assertion toakr2014-11-011-46/+64
| | | | | | | | join multiple threads without exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* A test renamed.akr2014-10-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_binwrite_string): Test writev() failure.akr2014-10-251-0/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb (TestIO#test_advise): avoid to infinite loop.hsbt2014-10-031-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb (TestIO#test_advise): added workaround of fadvise(2)hsbt2014-10-031-1/+9
| | | | | | with tmpfs and old linux kernel. [ruby-core:65355][Bug #10313] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_advice show OS and filesystem when failed.akr2014-10-021-1/+36
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_io.rb: use IO#nonblock=normal2014-09-051-1/+1
| | | | | | | * test/ruby/test_io.rb (test_readpartial_locktmp): use IO#nonblock= Old fcntl invocation may drop necessary flags on some platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_io.rb: avoid EBADFnormal2014-09-051-14/+19
| | | | | | | * test/ruby/test_io.rb (test_readpartial_locktmp): avoid EBADF [ruby-core:64773] [ruby-core:64775] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e