about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-03-14 16:38:58 -0700
committerEric Wong <normalperson@yhbt.net>2011-03-14 16:38:58 -0700
commita9bfa55f9a1d1c96d73367d3bb46f7b9e81fbbf9 (patch)
treea825ae5fb517d023e079147cb357a42b4a46718c /test
parent724f82bb5feaf1df40b02b8f353e94496f060647 (diff)
downloadraindrops-a9bfa55f9a1d1c96d73367d3bb46f7b9e81fbbf9.tar.gz
This matches behavior of the TCP version.
Diffstat (limited to 'test')
-rw-r--r--test/test_linux.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_linux.rb b/test/test_linux.rb
index d3c8da7..45dc2e0 100644
--- a/test/test_linux.rb
+++ b/test/test_linux.rb
@@ -39,6 +39,26 @@ class TestLinux < Test::Unit::TestCase
     assert_equal 1, stats[tmp.path].queued
   end
 
+  def test_unix_all
+    tmp = Tempfile.new("\xde\xad\xbe\xef") # valid path, really :)
+    File.unlink(tmp.path)
+    us = UNIXServer.new(tmp.path)
+    uc0 = UNIXSocket.new(tmp.path)
+    stats = unix_listener_stats
+    assert_equal 0, stats[tmp.path].active
+    assert_equal 1, stats[tmp.path].queued
+
+    uc1 = UNIXSocket.new(tmp.path)
+    stats = unix_listener_stats
+    assert_equal 0, stats[tmp.path].active
+    assert_equal 2, stats[tmp.path].queued
+
+    ua0 = us.accept
+    stats = unix_listener_stats
+    assert_equal 1, stats[tmp.path].active
+    assert_equal 1, stats[tmp.path].queued
+  end
+
   def test_tcp
     s = TCPServer.new(TEST_ADDR, 0)
     port = s.addr[1]