forked from podpalinc/rss-feed-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
util_test.go
81 lines (51 loc) · 1.62 KB
/
util_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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package podcast_test
import (
"testing"
podcast "github.com/georgboe/rss-feed-generator"
"github.com/stretchr/testify/assert"
)
func TestGenerateStringEmpty(t *testing.T) {
t.Parallel()
result := podcast.GenerateFeedString("")
assert.Len(t, result, 0)
}
func TestGenerateStringAmpersand(t *testing.T) {
t.Parallel()
result := podcast.GenerateFeedString("Kids & Family")
assert.Equal(t, result, "Kids & Family")
}
func TestGenerateStringLessThan(t *testing.T) {
t.Parallel()
result := podcast.GenerateFeedString("1 < 3")
assert.Equal(t, result, "1 < 3")
}
func TestGenerateStringGreaterThan(t *testing.T) {
t.Parallel()
result := podcast.GenerateFeedString("3 > 1")
assert.Equal(t, result, "3 > 1")
}
func TestGenerateStringApostrophe(t *testing.T) {
t.Parallel()
result := podcast.GenerateFeedString("Sophie's choice")
assert.Equal(t, result, "Sophie's choice")
}
func TestGenerateStringQuotation(t *testing.T) {
t.Parallel()
result := podcast.GenerateFeedString("He said \"what\"")
assert.Equal(t, result, "He said "what"")
}
func TestGenerateStringCopyrightSign(t *testing.T) {
t.Parallel()
result := podcast.GenerateFeedString("© Podpal Inc, 2020")
assert.Equal(t, result, "© Podpal Inc, 2020")
}
func TestGenerateStringSoundRecordingCopyright(t *testing.T) {
t.Parallel()
result := podcast.GenerateFeedString("℗ Podpal Inc, 2020")
assert.Equal(t, result, "℗ Podpal Inc, 2020")
}
func TestGenerateStringTrademark(t *testing.T) {
t.Parallel()
result := podcast.GenerateFeedString("™ Podpal Inc, 2020")
assert.Equal(t, result, "™ Podpal Inc, 2020")
}