-
Notifications
You must be signed in to change notification settings - Fork 14
/
utils_test.go
61 lines (53 loc) · 1.04 KB
/
utils_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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package getstream_test
import (
"testing"
getstream "github.com/GetStream/stream-go"
)
func TestFeedSlug(t *testing.T) {
feedSlug, err := getstream.ValidateFeedSlug("foo")
if err != nil {
t.Error(err)
}
if feedSlug != "foo" {
t.Error("feedSlug not 'foo'")
}
feedSlug, err = getstream.ValidateFeedSlug("f-o-o")
if err != nil {
t.Error(err)
}
if feedSlug != "f_o_o" {
t.Error("feedSlug not 'f_o_o'")
}
}
func TestFeedID(t *testing.T) {
feedID, err := getstream.ValidateFeedID("123")
if err != nil {
t.Error(err)
}
if feedID != "123" {
t.Error("feedID not '123'")
}
feedID, err = getstream.ValidateFeedID("1-2-3")
if err != nil {
t.Error(err)
}
if feedID != "1_2_3" {
t.Error("feedID not '1_2_3'")
}
}
func TestUserID(t *testing.T) {
userID, err := getstream.ValidateUserID("123")
if err != nil {
t.Error(err)
}
if userID != "123" {
t.Error("userID not '123'")
}
userID, err = getstream.ValidateUserID("1-2-3")
if err != nil {
t.Error(err)
}
if userID != "1_2_3" {
t.Error("userSlug not '1_2_3'")
}
}