diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-11 13:39:42 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-11 13:39:42 +0000 |
commit | 09492b5ab251982e440de039f7afc745d1fef8cc (patch) | |
tree | a9d75a666224ab321b98ef88c2b4bf09e9668a24 /test/test_pty.rb | |
parent | fb1d5520fa83bd34f6fde54350d2c7280d7c7a88 (diff) | |
download | ruby-09492b5ab251982e440de039f7afc745d1fef8cc.tar.gz |
add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_pty.rb')
-rw-r--r-- | test/test_pty.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_pty.rb b/test/test_pty.rb index 76986764cd..1f0f8d6b31 100644 --- a/test/test_pty.rb +++ b/test/test_pty.rb @@ -105,5 +105,23 @@ class TestPTY < Test::Unit::TestCase assert_equal(0600, s.mode & 0777) } end + + def test_close_master + PTY.open {|master, slave| + master.close + assert_raise(EOFError) { slave.readpartial(10) } + } + end + + def test_close_slave + PTY.open {|master, slave| + slave.close + # This exception is platform dependent. + assert_raise( + EOFError, # FreeBSD + Errno::EIO # GNU/Linux + ) { master.readpartial(10) } + } + end end if defined? PTY |