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