mimetype_test.go 276 B

12345678910111213
  1. package httputils
  2. import (
  3. "testing"
  4. )
  5. func TestDetectContentType(t *testing.T) {
  6. input := []byte("That is just a plain text")
  7. if contentType, _, err := DetectContentType(input); err != nil || contentType != "text/plain" {
  8. t.Error("TestDetectContentType failed")
  9. }
  10. }