mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 21:30:16 +02:00
fix tests
This commit is contained in:
parent
baf5d6f27f
commit
76fc3f1a77
1 changed files with 5 additions and 5 deletions
|
@ -9,16 +9,16 @@ import (
|
|||
|
||||
func TestTCP(t *testing.T) {
|
||||
timeToRoomDeletion = 100 * time.Millisecond
|
||||
go Run("debug", "8281", "8282")
|
||||
go Run("debug", "8281", "pass123", "8282")
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
c1, banner, _, err := ConnectToTCPServer("localhost:8281", "testRoom", 1*time.Minute)
|
||||
c1, banner, _, err := ConnectToTCPServer("localhost:8281", "pass123", "testRoom", 1*time.Minute)
|
||||
assert.Equal(t, banner, "8282")
|
||||
assert.Nil(t, err)
|
||||
c2, _, _, err := ConnectToTCPServer("localhost:8281", "testRoom")
|
||||
c2, _, _, err := ConnectToTCPServer("localhost:8281", "pass123", "testRoom")
|
||||
assert.Nil(t, err)
|
||||
_, _, _, err = ConnectToTCPServer("localhost:8281", "testRoom")
|
||||
_, _, _, err = ConnectToTCPServer("localhost:8281", "pass123", "testRoom")
|
||||
assert.NotNil(t, err)
|
||||
_, _, _, err = ConnectToTCPServer("localhost:8281", "testRoom", 1*time.Nanosecond)
|
||||
_, _, _, err = ConnectToTCPServer("localhost:8281", "pass123", "testRoom", 1*time.Nanosecond)
|
||||
assert.NotNil(t, err)
|
||||
|
||||
// try sending data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue