1 // Copyright 2021 The Go 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.
5 //go:build unix || (js && wasm)
13 func initMimeUnixTest(t *testing.T) {
15 err := loadMimeGlobsFile("testdata/test.types.globs2")
20 loadMimeFile("testdata/test.types")
23 func TestTypeByExtensionUNIX(t *testing.T) {
25 typeTests := map[string]string{
26 ".T1": "application/test",
27 ".t2": "text/test; charset=utf-8",
28 ".t3": "document/test",
29 ".t4": "example/test",
38 for ext, want := range typeTests {
39 val := TypeByExtension(ext)
41 t.Errorf("TypeByExtension(%q) = %q, want %q", ext, val, want)