Skip to content

Instantly share code, notes, and snippets.

@alxhub
Last active November 29, 2015 21:27
Show Gist options
  • Save alxhub/89ef7f236edb6d4c652a to your computer and use it in GitHub Desktop.
Save alxhub/89ef7f236edb6d4c652a to your computer and use it in GitHub Desktop.
func TestNetworkChannel_ModeChange(t *testing.T) {
var wg sync.WaitGroup
tn, hubA := newTestNetwork(t, "hub.a", &wg)
hubB := hubA.NewLink("hub.b")
// Two clients
alpha := hubA.NewClient("alpha")
beta := hubB.NewClient("beta")
// Both join #test
test := tn.NewChannel("test")
alpha.Join(test)
beta.Join(test)
// Alpha voices beta
alpha.SetMode(test, "+v", beta)
// Verify modes of both users
tn.ExpectAll(test.Member(alpha).IsOwner())
tn.ExpectAll(test.Member(beta).IsVoice())
// Cleanup
tn.Shutdown()
wg.Wait()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment