forked from Metalnem/zinio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
33 lines (29 loc) · 866 Bytes
/
main_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
package main
import "testing"
func TestSanitize(t *testing.T) {
tests := []struct {
Input string
Output string
}{
{"Hello World", "Hello World"},
{"Καλημέρα κόσμε", "Καλημέρα κόσμε"},
{"こんにちは 世界", "こんにちは 世界"},
{"Men's Health", "Men's Health"},
{"act!ve", "act!ve"},
{"Health & Fitness", "Health & Fitness"},
{"Fat-Burning Manual", "Fat-Burning Manual"},
{"Health Myths, Busted!", "Health Myths, Busted!"},
{".NET Magazine", ".NET Magazine"},
{"123 Easiest-Ever Recipes", "123 Easiest-Ever Recipes"},
{"Something: Else", "Something - Else"},
{"Something/Else", "Something - Else"},
{"Something Else?", "Something Else"},
}
for _, test := range tests {
want := test.Output
got := sanitize(test.Input)
if want != got {
t.Errorf("want %s, got %s", want, got)
}
}
}