aboutsummaryrefslogtreecommitdiffstats
path: root/test/io
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/io-console] Ignore chomp! result and return the modified stringNobuyoshi Nakada2021-01-051-0/+9
| | | | https://github.com/ruby/io-console/commit/09e5ccc729
* [ruby/io-console] Fix timeout type error (#18)Nobuyoshi Nakada2020-10-111-0/+4
| | | | | | | | | | | | | | | | | Fixed TypeError when IO#getch timed out `rb_io_wait` returns a bit-flags Integer representing available events, or Qfalse if timed out. Also the result of `NUM2INT` is not a `VALUE`. ``` $ ./bin/ruby -v -rio/console -e "p IO.console.getch(intr: true, time: 0.1)" ruby 3.0.0dev (2020-10-09T20:27:30Z master 5ea2ea74cc) [x64-mingw32] -e:1:in `getch': no implicit conversion of false into Integer (TypeError) from -e:1:in `<main>' ``` https://github.com/ruby/io-console/commit/3bdfaf62df
* [ruby/io-console] Bug 17128: In test_set_winsize_console, wrapped re-size in ↵Leam Hall2020-08-271-4/+8
| | | | | | a begin-rescue-else. https://github.com/ruby/io-console/commit/a22333c33a
* Add explicitly require for Dir.mktmpdirHiroshi SHIBATA2020-07-301-0/+1
|
* Use %w instead of %i not to create unused IDsNobuyoshi Nakada2020-05-091-1/+1
|
* test/io/console/test_io_console.rb: Rescue Errno::ENXIO for SolarisYusuke Endoh2020-05-091-1/+1
| | | | | | | | | https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris10-gcc/ruby-master/log/20200509T100003Z.fail.html.gz ``` 1) Failure: TestIO_Console#test_failed_path [/export/home/users/chkbuild/cb-gcc/tmp/build/20200509T100003Z/ruby/test/io/console/test_io_console.rb:40]: [Errno::ENODEV, Errno::ENOTTY, Errno::EBADF] exception expected, not #<Errno::ENXIO: No such device or address - /dev/null>. ```
* [ruby/io-console] Fails with EBADF on mingwNobuyoshi Nakada2020-05-091-1/+1
| | | | https://github.com/ruby/io-console/commit/530cec574c
* [ruby/io-console] Expanded expected errorsNobuyoshi Nakada2020-05-091-2/+6
| | | | | | May fail with ENOTTY instead of ENODEV. https://github.com/ruby/io-console/commit/fe117b89e0
* [ruby/io-console] Added test for failed pathNobuyoshi Nakada2020-05-091-0/+10
| | | | https://github.com/ruby/io-console/commit/06a540f9b4
* [ruby/io-console] Filter Ruby engine name rather than just /ruby/Charles Oliver Nutter2020-01-181-1/+1
| | | | | | | This breaks tests using this path on JRuby because the `jruby` executable turns into `jjruby` after the sub. https://github.com/ruby/io-console/commit/e5951aa34c
* [ruby/io-console] Enable only interrupt bits on `intr: true`Nobuyoshi Nakada2019-12-291-0/+5
| | | | https://github.com/ruby/io-console/commit/baaf929041
* Scale sleeping times to wait for the OS operationsNobuyoshi Nakada2019-12-241-0/+4
|
* Synchronize with a Queue instead of sleepingNobuyoshi Nakada2019-12-241-4/+12
|
* Revert "Scale sleeping times"Koichi Sasada2019-12-241-4/+0
| | | | | | | | This reverts commit e57d6194218efc73c30f3fed9dd321d2e357030b. Test fails: http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sky1/2518563 http://ci.rvm.jp/results/trunk-gc_compact@silicon-docker/2518533
* Scale sleeping timesNobuyoshi Nakada2019-12-241-0/+4
|
* [ruby/io-console] Skip Interrupt test on LinuxNobuyoshi Nakada2019-12-181-1/+1
| | | | | | Hangs up only in ruby/ruby on Travis-CI. https://github.com/ruby/io-console/commit/de39aa6dd6
* [ruby/io-console] Set raw mode strictly same as cfmakerawNobuyoshi Nakada2019-12-181-1/+1
| | | | | | | | | | * Default VMIN and VTIME to minimum input. * Disable parity check bits explicitly. * Disable all bits for flow control on input. Co-Authored-By: NARUSE, Yui <naruse@airemix.jp> https://github.com/ruby/io-console/commit/5ce201a686
* [ruby/io-console] Skip interruptNobuyoshi Nakada2019-12-181-1/+1
| | | | https://github.com/ruby/io-console/commit/8ed5a2bcc3
* [ruby/io-console] Timeout in the child processNobuyoshi Nakada2019-12-171-2/+3
| | | | https://github.com/ruby/io-console/commit/b8411689a5
* [ruby/io-console] Use IO.console instead of STDINNobuyoshi Nakada2019-12-171-3/+4
| | | | https://github.com/ruby/io-console/commit/9e3ec5b936
* [ruby/io-console] Disable implementation-defined special control charactersNobuyoshi Nakada2019-12-171-0/+10
| | | | | | In raw mode with interrupt enabled. https://github.com/ruby/io-console/commit/e9e8e3ff17
* [ruby/io-console] Added the test for intr optionNobuyoshi Nakada2019-12-171-0/+36
| | | | https://github.com/ruby/io-console/commit/4f01db102d
* test/io/console/test_io_console.rb: add a memo for the mysterious hackYusuke Endoh2019-12-051-1/+11
|
* test/io/console/test_io_console.rb: Try the hack for SolarisYusuke Endoh2019-12-051-1/+1
| | | | | | I'm not entirely sure why, but test_set_winsize_console gets stuck on Solaris (and if I recall, macOS). I found a hack for FreeBSD, so I want to give it a try on Solaris too.
* Wait for the main thread to start reading by QueueNobuyoshi Nakada2019-12-021-0/+5
| | | | | Otherwise, the written data to pty before the reading started may be just lost.
* Revert "[ruby/io-console] Skip cursor position test on Solaris"Kazuhiro NISHIYAMA2019-09-251-1/+0
| | | | This reverts commit 5294ded681992ced2ecbd31c814b63265d2f591e.
* [ruby/io-console] Unique paths to be addedNobuyoshi Nakada2019-09-251-0/+1
| | | | https://github.com/ruby/io-console/commit/a3ad851b6c
* [ruby/io-console] Load the current librariesNobuyoshi Nakada2019-09-251-1/+3
| | | | https://github.com/ruby/io-console/commit/ab7653c543
* [ruby/io-console] Skip cursor position test on SolarisNobuyoshi Nakada2019-09-251-0/+1
| | | | | | It results in a mysterious failure. https://github.com/ruby/io-console/commit/e3543c3da4
* [ruby/io-console] Made cursor position 0-originNobuyoshi Nakada2019-09-241-0/+20
| | | | https://github.com/ruby/io-console/commit/9377e37295
* test_io_wait.rb: try to stabilize test_wait_readablek0kubun2018-12-311-1/+1
| | | | | | | that randomly fails https://rubyci.org/logs/mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-trunk/log/20181231T103312Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Suppress uninitialized instance variable warningsnobu2018-12-141-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io + socket: make pipes and sockets nonblocking by defaultnormal2018-11-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | All normal Ruby IO methods (IO#read, IO#gets, IO#write, ...) are all capable of appearing to be "blocking" when presented with a file description with the O_NONBLOCK flag set; so there is little risk of incompatibility within Ruby-using programs. The biggest compatibility risk is when spawning external programs. As a result, stdin, stdout, and stderr are now always made blocking before exec-family calls. This change will make an event-oriented MJIT usable if it is waiting on pipes on POSIX_like platforms. It is ALSO necessary to take advantage of (proposed lightweight concurrency (aka "auto-Fiber") or any similar proposal for network concurrency: https://bugs.ruby-lang.org/issues/13618 Named-pipe (FIFO) are NOT yet non-blocking by default since they are rarely-used and may introduce compatibility problems and extra syscall overhead for a common path. Please revert this commit if there are problems and if I am afk since I am afk a lot, lately. [ruby-core:89950] [Bug #14968] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/io/wait/test_io_wait_uncommon.rb: relax /dev/random checknormal2018-08-251-1/+7
| | | | | | | | | | Too many machines lack entropy to have a usable /dev/random. I had similar problems on my system until I started using haveged(8), but we can't require that for CI. cf. https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-trunk/log/20180825T213003Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/io/console/test_io_console.rb: fix short read failuresnormal2018-08-091-14/+14
| | | | | | | | Running with TESTS=--no-retry, I sometimes get short reads leading to failures due to the use of IO#readpartial instead of IO#gets. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/io/wait/test_io_wait_uncommon.rb (test_tty_wait): increase timeoutnormal2018-08-091-1/+1
| | | | | | | Apparently my tty can't keep up when I run test-all with TESTS='-v --no-retry' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/io/console/test_io_console.rb: fix for systems where PTY is not definednormal2018-06-061-5/+4
| | | | | | | [ruby-core:87420] [Bug #14828] Thanks-to: MSP-Greg (Greg L) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/io/console/test_io_console.rb: ignore TTOU on FreeBSDnormal2018-06-051-0/+16
| | | | | | | I'm not entirely sure why, but SIGTTOU pauses the test when running test-all in parallel. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io_wait_uncommon: new test for uncommon file typesnormal2018-05-151-0/+72
| | | | | | | | This should make portability problems more apparent when we try using ppoll with rb_wait_for_single_fd on FreeBSD or other non-Linux platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/io/console/test_io_console.rb (test_oflush): Avoid race conditionmame2018-02-151-0/+1
| | | | | | Add a ad-hoc wait. Follows test_ioflush2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io_console.rb: get rid of sporadic failuresnobu2017-12-231-1/+3
| | | | | | | | | * test/io/console/test_io_console.rb (test_getpass): try to get rid of timing issues. * test/io/console/test_io_console.rb (test_ioflush2): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io_console.rb: flushnobu2017-09-281-0/+4
| | | | | | | * test/io/console/test_io_console.rb: flush to ensure the second data is sent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: set winsize on Windowsnobu2017-09-111-0/+5
| | | | | | | * ext/io/console/console.c (console_set_winsize): retry shrinking window and screen buffer. [ruby-core:82741] [Bug #13888] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io_console.rb: test_set_winsize_consolenobu2017-09-111-27/+35
| | | | | | | | * test/io/console/test_io_console.rb (test_set_winsize_console): split from test_get_winsize_console and enable the case when attached to a console already git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Hide NotImplementedError for windowsmame2017-09-051-0/+1
| | | | | | https://github.com/ruby/ruby/commit/440dc6b7e0b3b74db221eed81871516e301d4b3e#commitcomment-24074203 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Improve line covearge of ext/io/nonblock/nonblock.c from 54.5% to 95.5%mame2017-09-041-0/+18
| | | | | | Not so good test, but it would be better than nothing, I guess... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io_console.rb: fix of old CentOS5nobu2017-01-081-2/+2
| | | | | | | * test/io/console/test_io_console.rb (test_winsize): on old CentOS5 window size seems unable to be set across a pty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: unpaired sizenobu2017-01-071-0/+1
| | | | | | | * ext/io/console/console.c (console_set_winsize): reject unpaired pixel size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* console.c: OOB accessnobu2017-01-071-0/+30
| | | | | | | * ext/io/console/console.c (console_set_winsize): fix out-of-bounds access. [ruby-core:79004] [Bug #13112] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io/console: unknown key code for names with nulnobu2016-04-151-0/+15
| | | | | | | | | | * ext/io/console/console.c (console_key_pressed_p): raise the same exception, "unknown virtual key code", for names with nul chars. though console_win32_vk() considers the length and can deal with nul chars, rb_sprintf() raised at PRIsVALUE previously, so quote it if it is unprintable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e