mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-10-30 11:46:16 +00:00
20 lines
470 B
Go
20 lines
470 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestMimeData(t *testing.T) {
|
|
check := func(ext string, expectedIsText bool, expectedMimeId int) {
|
|
isText, mimeId := mimeData(ext)
|
|
if isText != expectedIsText || mimeId != expectedMimeId {
|
|
t.Error(ext, isText, mimeId)
|
|
}
|
|
}
|
|
check(".txt", true, int(TextPlain))
|
|
check(".gmi", true, int(TextGemini))
|
|
check(".bin", false, int(BinaryOctet))
|
|
check(".jpg", false, int(BinaryJpeg))
|
|
check(".bin", false, int(BinaryOctet))
|
|
}
|