-
Notifications
You must be signed in to change notification settings - Fork 11
/
filters_test.go
42 lines (34 loc) · 980 Bytes
/
filters_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package gothumbor
import (
"strings"
"testing"
)
var auxURLs = []string{
"http://my.server.com/some/path/to/image-01.jpg",
"http://my.server.com/some/path/to/image-02.jpg",
"http://my.server.com/some/path/to/image-03.jpg",
"http://my.server.com/some/path/to/image-04.jpg",
}
func TestDistributedCollageFilter(t *testing.T) {
orientation := "horizontal"
alignment := "smart"
filter := DistributedCollageFilter(orientation, alignment, auxURLs)
index := strings.Index(filter, "distributed_collage")
if index < 0 {
t.Errorf("%s should contain “distributed_collage”", filter)
}
index = strings.Index(filter, "horizontal")
if index < 0 {
t.Errorf("%s should contain “horizontal”", filter)
}
index = strings.Index(filter, "smart")
if index < 0 {
t.Errorf("%s should contain “smart”", filter)
}
for _, url := range auxURLs {
index = strings.Index(filter, url)
if index < 0 {
t.Errorf("%s should contain “%s”", filter, url)
}
}
}