[BUGFIX] test on tcp6 (instatt unix)
This commit is contained in:
		
							parent
							
								
									faff3e4f63
								
							
						
					
					
						commit
						5628d7db22
					
				@ -12,7 +12,7 @@ import (
 | 
			
		||||
func TestConnectError(t *testing.T) {
 | 
			
		||||
	assert := assert.New(t)
 | 
			
		||||
	assert.Panics(func() {
 | 
			
		||||
		Dial("unix", "/tmp/yanic-database-error.socket")
 | 
			
		||||
		Dial("tcp6", "[::]:30303")
 | 
			
		||||
	}, "could connect")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -20,12 +20,12 @@ func TestRecieveMessages(t *testing.T) {
 | 
			
		||||
	assert := assert.New(t)
 | 
			
		||||
	server, err := socket.Connect(map[string]interface{}{
 | 
			
		||||
		"enable":  true,
 | 
			
		||||
		"type":    "unix",
 | 
			
		||||
		"address": "/tmp/yanic-database.socket",
 | 
			
		||||
		"type":    "tcp6",
 | 
			
		||||
		"address": "[::]:1337",
 | 
			
		||||
	})
 | 
			
		||||
	assert.NoError(err)
 | 
			
		||||
 | 
			
		||||
	d := Dial("unix", "/tmp/yanic-database.socket")
 | 
			
		||||
	d := Dial("tcp6", "[::]:1337")
 | 
			
		||||
	assert.NotNil(d)
 | 
			
		||||
	go d.Start()
 | 
			
		||||
	time.Sleep(5 * time.Millisecond)
 | 
			
		||||
 | 
			
		||||
@ -26,8 +26,8 @@ func TestStartup(t *testing.T) {
 | 
			
		||||
	assert.Error(err, "connection should not work")
 | 
			
		||||
	assert.Nil(conn)
 | 
			
		||||
 | 
			
		||||
	config["type"] = "unix"
 | 
			
		||||
	config["address"] = "/tmp/yanic-database.socket"
 | 
			
		||||
	config["type"] = "tcp6"
 | 
			
		||||
	config["address"] = "[::]:1337"
 | 
			
		||||
 | 
			
		||||
	conn, err = Connect(config)
 | 
			
		||||
	assert.NoError(err, "connection should work")
 | 
			
		||||
@ -42,14 +42,14 @@ func TestClient(t *testing.T) {
 | 
			
		||||
	config := make(map[string]interface{})
 | 
			
		||||
 | 
			
		||||
	config["enable"] = true
 | 
			
		||||
	config["type"] = "unix"
 | 
			
		||||
	config["address"] = "/tmp/yanic-database2.socket"
 | 
			
		||||
	config["type"] = "tcp6"
 | 
			
		||||
	config["address"] = "[::]:1337"
 | 
			
		||||
 | 
			
		||||
	conn, err := Connect(config)
 | 
			
		||||
	assert.NoError(err, "connection should work")
 | 
			
		||||
	assert.NotNil(conn)
 | 
			
		||||
 | 
			
		||||
	client, err := net.Dial("unix", "/tmp/yanic-database2.socket")
 | 
			
		||||
	client, err := net.Dial("tcp6", "[::]:1337")
 | 
			
		||||
	assert.NoError(err, "connection should work")
 | 
			
		||||
	assert.NotNil(client)
 | 
			
		||||
	time.Sleep(time.Duration(3) * time.Microsecond)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user