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