|
|
@@ -38,29 +38,29 @@ 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": ""}}},
|
|
|
}
|
|
|
|
|
|
func TestParseExtensions(t *testing.T) {
|