From d118c84b0b9110462e479487ffaf175a75e5718e Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 14 Jun 2019 17:50:31 -0700 Subject: Fix IO#scanf on pipes on Windows IO.seek on a pipe on Windows raises Errno::EINVAL instead of Errno::ESPIPE. Fixes Ruby Bug #15199 --- test/scanf/test_scanfio.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/scanf') diff --git a/test/scanf/test_scanfio.rb b/test/scanf/test_scanfio.rb index cec8750aef..f7c439276d 100644 --- a/test/scanf/test_scanfio.rb +++ b/test/scanf/test_scanfio.rb @@ -17,5 +17,12 @@ class TestScanfIO < Test::Unit::TestCase ensure fh.close end + + def test_pipe_scanf + r, w = IO.pipe + w.write('a') + w.close + assert_equal([], r.scanf('a')) + end end -- cgit v1.2.3