Initial commit

This commit is contained in:
2018-03-06 23:56:21 +00:00
commit 53d6b98865
5 changed files with 140 additions and 0 deletions

23
mimedb_test.go Normal file
View File

@@ -0,0 +1,23 @@
package mimedb
import (
"mime"
"testing"
)
func TestLoadTypes(t *testing.T) {
if mime.TypeByExtension(".webmanifest") != "" {
t.Log("We have .webmanifest BEFORE loading the DB. Passing would be false negative!")
t.Fail()
}
if err := LoadTypes(); err != nil {
t.Logf("Unexpected error loading types: %s", err)
t.Fail()
}
if mime.TypeByExtension(".webmanifest") != "application/manifest+json" {
t.Logf("A MIME type for .webmanifest was not found")
t.Fail()
}
}