Skip to content

Commit 01d5637

Browse files
committed
Rework the tests to make a bit more sense
1 parent cb06878 commit 01d5637

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/mime/testdata/test.types.globs2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55

66
# mime package test for globs2
7-
50:application/test:*.t1
8-
50:text/test:*.t2
7+
50:document/test:*.t3
8+
50:example/test:*.t4

src/mime/type_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func initMimeUnix() {
9797
}
9898

9999
func initMimeForTests() map[string]string {
100-
mimeGlobs = []string{"testdata/test.types.globs2"}
100+
mimeGlobs = []string{""}
101101
typeFiles = []string{"testdata/test.types"}
102102
return map[string]string{
103103
".T1": "application/test",

src/mime/type_unix_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@ import (
88
"testing"
99
)
1010

11-
func initMimeUnixTest() {
11+
func initMimeUnixTest(t *testing.T) {
1212
err := loadMimeGlobsFile("testdata/test.types.globs2")
1313
if err != nil {
14-
panic(err)
14+
t.Fatal(err)
1515
}
1616

1717
loadMimeFile("testdata/test.types")
1818
}
1919

2020
func TestTypeByExtensionUNIX(t *testing.T) {
21-
initMimeUnixTest()
21+
initMimeUnixTest(t)
2222
typeTests := map[string]string{
2323
".T1": "application/test",
2424
".t2": "text/test; charset=utf-8",
25+
".t3": "document/test",
26+
".t4": "example/test",
2527
".png": "image/png",
2628
}
2729

0 commit comments

Comments
 (0)