pkg/httputils/mimetype_test.go
Kristina Zabunova a5efa69750 unit test refactor in pkg/httputils as suggested by vdemeester; using pattern if x := …; x == nil {}
Signed-off-by: Kristina Zabunova <triara.xiii@gmail.com>
(cherry picked from commit c3f1b2a5bd4a4330bcbad401c316af90925b99ad)
2015-08-28 10:41:19 -04:00

13 lines
277 B
Go

package httputils
import (
"testing"
)
func TestDetectContentType(t *testing.T) {
input := []byte("That is just a plain text")
if contentType, _, err := DetectContentType(input); err != nil || contentType != "text/plain" {
t.Errorf("TestDetectContentType failed")
}
}