-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathutilities_test.go
30 lines (24 loc) · 1 KB
/
utilities_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
package sportmonks
import "testing"
func TestIntSliceToSepString(t *testing.T) {
ret := IntSliceToSepString([]int{}, "")
if ret != "" {
t.Errorf("IntSliceToSepString of []int {} with \"\" separator was incorrect. Got: \"%v\". Want: \"\"", ret)
}
ret = IntSliceToSepString([]int{}, ",")
if ret != "" {
t.Errorf("IntSliceToSepString of []int {} with \",\" separator was incorrect. Got: \"%v\". Want: \"\"", ret)
}
ret = IntSliceToSepString([]int{1, 2, 3}, "")
if ret != "123" {
t.Errorf("IntSliceToSepString of []int {1, 2, 3} with \"\" separator was incorrect. Got: \"%v\". Want: \"%v\"", ret, "123")
}
ret = IntSliceToSepString([]int{1, 2, 3}, ",")
if ret != "1,2,3" {
t.Errorf("IntSliceToSepString of []int {1, 2, 3} with \",\" separator was incorrect. Got: \"%v\". Want: \"%v\"", ret, "1,2,3")
}
ret = IntSliceToSepString([]int{1, 2, 3}, "-")
if ret != "1-2-3" {
t.Errorf("IntSliceToSepString of []int {1, 2, 3} with \"-\" separator was incorrect. Got: \"%v\". Want: \"%v\"", ret, "1-2-3")
}
}