package callstest import ( "strings" "testing" "time" ) // Spec §15.28: every roster names what each peer's participation was // opened from — an app's own " " header, "native" for an // app from before it (the Go HTTP client's agent and no header), nothing // for a browser — and the `peer` event that admits a newcomer carries it. func TestRosterNamesEachPeersClient(t *testing.T) { for _, c := range []struct { name string headers map[string]string want string // the roster's client for Bob; "" is no key at all }{ {"an app that says", map[string]string{"User-Agent": "Go-http-client/1.1", "X-Calls-Client": "mac 0.4.12"}, `"client":"mac 0.4.12"`}, {"an app from before", map[string]string{"User-Agent": "Go-http-client/1.1"}, `"client":"native"`}, {"a browser", nil, ""}, {"a header that is not one", map[string]string{"User-Agent": "Go-http-client/1.1", "X-Calls-Client": "mac