diff options
author | Kevin Chabowski <kevin@kch42.de> | 2014-03-25 22:27:15 +0100 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2014-03-25 22:27:15 +0100 |
commit | fe179701f2cb32be250b3b882a02b02acad1cae5 (patch) | |
tree | ab54ee5f71fabf1e6df207657e3143701596b6a3 /chat | |
parent | 256027bece912fefd7e27c954936e2fb37a6b80d (diff) | |
download | simplechat-fe179701f2cb32be250b3b882a02b02acad1cae5.tar.gz simplechat-fe179701f2cb32be250b3b882a02b02acad1cae5.tar.bz2 simplechat-fe179701f2cb32be250b3b882a02b02acad1cae5.zip |
Expanded TestLeave
Diffstat (limited to 'chat')
-rw-r--r-- | chat/chat_test.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/chat/chat_test.go b/chat/chat_test.go index bd4d1cb..fcdf4c9 100644 --- a/chat/chat_test.go +++ b/chat/chat_test.go @@ -45,13 +45,24 @@ func TestJoining(t *testing.T) { func TestLeaving(t *testing.T) { InitRooms(10) - b1, _, err := Join("test", "Foo") + b1, r, err := Join("test", "Foo") if err != nil { t.Fatalf("Could not join room: %s", err) } + b2, _, err := Join("test", "Bar") + b1.Leave() + buddies := r.ListBuddies() + for _, b := range buddies { + if b == "Foo" { + t.Error("Foo is still in buddy list, even after leaving") + } + } + + b2.Leave() + // The room is now empty. It should no longer exist. if _, ok := rooms["test"]; ok { t.Error("Room test still exists, although no user is left") |