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 aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris
13 func initMimeUnixTest(t
*testing
.T
) {
14 err
:= loadMimeGlobsFile("testdata/test.types.globs2")
19 loadMimeFile("testdata/test.types")
22 func TestTypeByExtensionUNIX(t
*testing
.T
) {
24 typeTests
:= map[string]string{
25 ".T1": "application/test",
26 ".t2": "text/test; charset=utf-8",
27 ".t3": "document/test",
28 ".t4": "example/test",
32 for ext
, want
:= range typeTests
{
33 val
:= TypeByExtension(ext
)
35 t
.Errorf("TypeByExtension(%q) = %q, want %q", ext
, val
, want
)