From 961c04cae992eadb42d286d2f85f8a675bdc68c8 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 29 Jan 2018 14:17:40 -0800 Subject: Upgrading server dependancies (#8154) --- vendor/github.com/gorilla/websocket/util_test.go | 49 +++++++++++++++++------- 1 file changed, 35 insertions(+), 14 deletions(-) (limited to 'vendor/github.com/gorilla/websocket/util_test.go') diff --git a/vendor/github.com/gorilla/websocket/util_test.go b/vendor/github.com/gorilla/websocket/util_test.go index 610e613c0..6e15965f5 100644 --- a/vendor/github.com/gorilla/websocket/util_test.go +++ b/vendor/github.com/gorilla/websocket/util_test.go @@ -10,6 +10,24 @@ import ( "testing" ) +var equalASCIIFoldTests = []struct { + t, s string + eq bool +}{ + {"WebSocket", "websocket", true}, + {"websocket", "WebSocket", true}, + {"Öyster", "öyster", false}, +} + +func TestEqualASCIIFold(t *testing.T) { + for _, tt := range equalASCIIFoldTests { + eq := equalASCIIFold(tt.s, tt.t) + if eq != tt.eq { + t.Errorf("equalASCIIFold(%q, %q) = %v, want %v", tt.s, tt.t, eq, tt.eq) + } + } +} + var tokenListContainsValueTests = []struct { value string ok bool @@ -38,29 +56,32 @@ var parseExtensionTests = []struct { value string extensions []map[string]string }{ - {`foo`, []map[string]string{map[string]string{"": "foo"}}}, + {`foo`, []map[string]string{{"": "foo"}}}, {`foo, bar; baz=2`, []map[string]string{ - map[string]string{"": "foo"}, - map[string]string{"": "bar", "baz": "2"}}}, + {"": "foo"}, + {"": "bar", "baz": "2"}}}, {`foo; bar="b,a;z"`, []map[string]string{ - map[string]string{"": "foo", "bar": "b,a;z"}}}, + {"": "foo", "bar": "b,a;z"}}}, {`foo , bar; baz = 2`, []map[string]string{ - map[string]string{"": "foo"}, - map[string]string{"": "bar", "baz": "2"}}}, + {"": "foo"}, + {"": "bar", "baz": "2"}}}, {`foo, bar; baz=2 junk`, []map[string]string{ - map[string]string{"": "foo"}}}, + {"": "foo"}}}, {`foo junk, bar; baz=2 junk`, nil}, {`mux; max-channels=4; flow-control, deflate-stream`, []map[string]string{ - map[string]string{"": "mux", "max-channels": "4", "flow-control": ""}, - map[string]string{"": "deflate-stream"}}}, + {"": "mux", "max-channels": "4", "flow-control": ""}, + {"": "deflate-stream"}}}, {`permessage-foo; x="10"`, []map[string]string{ - map[string]string{"": "permessage-foo", "x": "10"}}}, + {"": "permessage-foo", "x": "10"}}}, {`permessage-foo; use_y, permessage-foo`, []map[string]string{ - map[string]string{"": "permessage-foo", "use_y": ""}, - map[string]string{"": "permessage-foo"}}}, + {"": "permessage-foo", "use_y": ""}, + {"": "permessage-foo"}}}, {`permessage-deflate; client_max_window_bits; server_max_window_bits=10 , permessage-deflate; client_max_window_bits`, []map[string]string{ - map[string]string{"": "permessage-deflate", "client_max_window_bits": "", "server_max_window_bits": "10"}, - map[string]string{"": "permessage-deflate", "client_max_window_bits": ""}}}, + {"": "permessage-deflate", "client_max_window_bits": "", "server_max_window_bits": "10"}, + {"": "permessage-deflate", "client_max_window_bits": ""}}}, + {"permessage-deflate; server_no_context_takeover; client_max_window_bits=15", []map[string]string{ + {"": "permessage-deflate", "server_no_context_takeover": "", "client_max_window_bits": "15"}, + }}, } func TestParseExtensions(t *testing.T) { -- cgit v1.2.3-1-g7c22