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" {
|
2015-06-30 17:49:00 +00:00
|
|
|
t.Errorf("TestDetectContentType failed")
|
|
|
|
}
|
|
|
|
}
|