mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 21:48:13 -08:00
21 lines
298 B
Go
21 lines
298 B
Go
package bimg
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestRead(t *testing.T) {
|
|
buf, err := Read("fixtures/test.jpg")
|
|
|
|
if err != nil {
|
|
t.Errorf("Cannot read the image: %#v", err)
|
|
}
|
|
|
|
if len(buf) == 0 {
|
|
t.Fatal("Empty buffer")
|
|
}
|
|
|
|
if DetermineImageType(buf) != JPEG {
|
|
t.Fatal("Image is not jpeg")
|
|
}
|
|
}
|