-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex_test.go
58 lines (53 loc) · 1.12 KB
/
index_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
package handler_test
import (
"testing"
"gotest.tools/assert"
handler "github.com/doms/spongemock"
)
func TestSpongeMock(t *testing.T) {
testCases := []struct {
testStr string
expectedStr string
}{
{
testStr: "test",
expectedStr: "TeSt",
}, {
testStr: "",
expectedStr: "",
}, {
testStr: " test ",
expectedStr: " TeSt ",
}, {
testStr: "こんにちは",
expectedStr: "こんにちは",
}, {
testStr: "swaこんg",
expectedStr: "SwAこんg",
}, {
testStr: "hey @user, how's it going?",
expectedStr: "HeY @user, HoW'S it GoinG?",
}, {
testStr: "the party is happening in #party-room",
expectedStr: "ThE PaRtY is HaPpEninG in #party-room",
}, {
testStr: "<USERID|User>",
expectedStr: "<USERID|User>",
}, {
testStr: "20",
expectedStr: "20",
}, {
testStr: "20_20",
expectedStr: "20_20",
}, {
testStr: "2020",
expectedStr: "2020",
}, {
testStr: "2",
expectedStr: "2",
},
}
for _, test := range testCases {
assert.Equal(t, handler.SpongeMock(test.testStr), test.expectedStr)
}
}