Add tests for socket:write/socket:read, #474
socket:read returns shortest pattern. #474