Index: test/test_index
===================================================================
--- test/test_index	(revision 2170)
+++ test/test_index	(working copy)
@@ -63,6 +63,7 @@
 testZlib.rb
 testExpressions.rb
 testEnumerable.rb
+testSocket.rb
 
 # MRI Ruby tests (from sample/test.rb in Matz's Ruby Interpreter):
 
Index: test/testSocket.rb
===================================================================
--- test/testSocket.rb	
+++ test/testSocket.rb	
@@ -0,0 +1,26 @@
+require 'test/minirunit'
+require 'socket'
+
+server_read = nil
+client_read = nil
+
+server_thread = Thread.new do
+  serv = TCPServer.new('localhost',2202)
+  sock = serv.accept
+  
+  server_read = sock.read(5)
+  sock.write "world!"
+  sock.close
+end
+
+sleep(1) # artificial delay and not guaranteed to allow server_thread to start listening; better way?
+
+socket = TCPSocket.new("localhost",2202)
+
+socket.write "Hello"
+client_read = socket.read(6)
+socket.close
+server_thread.join
+
+test_equal("Hello", server_read)
+test_equal("world!", client_read)
\ No newline at end of file

