| 1 | package gitrepo |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | func TestGzipContentEncoding(t *testing.T) { |
| 6 | cases := []struct{ in, want string }{ |
| 7 | {"", ""}, |
| 8 | {"identity", ""}, |
| 9 | {"deflate", ""}, |
| 10 | {"gzip", "gzip"}, |
| 11 | {"GZIP", "gzip"}, |
| 12 | {"x-gzip", "x-gzip"}, |
| 13 | {"gzip, deflate", "gzip"}, |
| 14 | {" gzip ", "gzip"}, |
| 15 | } |
| 16 | for _, tc := range cases { |
| 17 | if got := gzipContentEncoding(tc.in); got != tc.want { |
| 18 | t.Errorf("%q: %q, verwacht %q", tc.in, got, tc.want) |
| 19 | } |
| 20 | } |
| 21 | } |