2015-06-30 17:49:00 +00:00
|
|
|
package httputils
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestDetectContentType(t *testing.T) {
|
|
|
|
input := []byte("That is just a plain text")
|
|
|
|
|
2015-07-01 15:42:13 +00:00
|
|
|
if contentType, _, err := DetectContentType(input); err != nil || contentType != "text/plain" {
|
2016-11-14 09:01:17 +00:00
|
|
|
t.Error("TestDetectContentType failed")
|
2015-06-30 17:49:00 +00:00
|
|
|
}
|
|
|
|
}
|