* gcc.dg/guality/guality.exp: Skip on AIX.
[official-gcc.git] / libgo / go / mime / type_test.go
blob07e1cd5daecfbfb84896a582fd1c1b3be9eb1705
1 // Copyright 2010 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 package mime
7 import "testing"
9 var typeTests = initMimeForTests()
11 func TestTypeByExtension(t *testing.T) {
12 for ext, want := range typeTests {
13 val := TypeByExtension(ext)
14 if val != want {
15 t.Errorf("TypeByExtension(%q) = %q, want %q", ext, val, want)
21 func TestCustomExtension(t *testing.T) {
22 custom := "text/xml; charset=iso-8859-1"
23 if error := AddExtensionType(".xml", custom); error != nil {
24 t.Fatalf("error %s for AddExtension(%s)", error, custom)
26 if registered := TypeByExtension(".xml"); registered != custom {
27 t.Fatalf("registered %s instead of %s", registered, custom)