File: mimedb_test.go

package info (click to toggle)
golang-gitlab-lupine-go-mimedb 1.33.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 156 kB
  • sloc: makefile: 5
file content (23 lines) | stat: -rw-r--r-- 483 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()
	}
}