Use ruby to suppress a warning message by cmd.exe

It is expected that reading from command with offset fails by ESPIPE
and the pipe will be closed immediately.  While this causes the child
process to terminate by SIGPIPE usually, cmd.exe yields the message
bellow.

```
The process tried to write to a nonexistent pipe.
```
This commit is contained in:
Nobuyoshi Nakada 2024-08-22 15:20:07 +09:00 committed by Nobuyoshi Nakada
parent 29500e3034
commit 004c6a6ed1
Notes: git 2024-08-22 07:33:13 +00:00

View File

@ -2543,7 +2543,7 @@ class TestIO < Test::Unit::TestCase
end
assert_raise(Errno::ESPIPE) do
assert_deprecated_warning(/IO process creation with a leading '\|'/) do # https://bugs.ruby-lang.org/issues/19630
IO.read("|echo foo", 1, 1)
IO.read("|#{EnvUtil.rubybin} -e 'puts :foo'", 1, 1)
end
end
end