1
// Copyright 2014 The Gorilla WebSocket Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
12
var tokenListContainsValueTests = []struct {
19
{"websockets", false},
20
{"x websocket", false},
21
{"websocket x", false},
22
{"other,websocket,more", true},
23
{"other, websocket, more", true},
26
func TestTokenListContainsValue(t *testing.T) {
27
for _, tt := range tokenListContainsValueTests {
28
h := http.Header{"Upgrade": {tt.value}}
29
ok := tokenListContainsValue(h, "Upgrade", "websocket")
31
t.Errorf("tokenListContainsValue(h, n, %q) = %v, want %v", tt.value, ok, tt.ok)