compiler: revert `for package-scope "a = b; b = x" just set "a = x"`
[official-gcc.git] / libgo / go / mime / type_unix_test.go
blob4d109aa71a228eb1124900ad22242bdf9d06c303
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
7 package mime
9 import (
10 "testing"
13 func initMimeUnixTest(t *testing.T) {
14 err := loadMimeGlobsFile("testdata/test.types.globs2")
15 if err != nil {
16 t.Fatal(err)
19 loadMimeFile("testdata/test.types")
22 func TestTypeByExtensionUNIX(t *testing.T) {
23 initMimeUnixTest(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",
29 ".png": "image/png",
32 for ext, want := range typeTests {
33 val := TypeByExtension(ext)
34 if val != want {
35 t.Errorf("TypeByExtension(%q) = %q, want %q", ext, val, want)