@@ -10,7 +10,7 @@ func TestSlug(t *testing.T) {
10
10
t .Run ("Empty" , func (t * testing.T ) {
11
11
assert .Equal (t , "" , Slug ("" ))
12
12
})
13
- t .Run ("BillGates " , func (t * testing.T ) {
13
+ t .Run ("Gates " , func (t * testing.T ) {
14
14
assert .Equal (t , "william-henry-gates-iii" , Slug ("William Henry Gates III" ))
15
15
})
16
16
t .Run ("Quotes" , func (t * testing.T ) {
@@ -19,13 +19,26 @@ func TestSlug(t *testing.T) {
19
19
t .Run ("Chinese" , func (t * testing.T ) {
20
20
assert .Equal (t , "chen-zhao" , Slug (" 陈 赵" ))
21
21
})
22
+ t .Run ("Emoji" , func (t * testing.T ) {
23
+ assert .Equal (t , "_5cpzfdq" , Slug ("💎" ))
24
+ assert .Equal (t , "_5cpzfea" , Slug ("💐" ))
25
+ assert .Equal (t , "_5cpzfea" , Slug (" 💐 " ))
26
+ assert .Equal (t , "_5cpzfdxqt5jja" , Slug ("💎💐" ))
27
+ assert .Equal (t , "photoprism" , Slug ("PhotoPrism 💎" ))
28
+ })
22
29
}
23
30
24
31
func TestSlugToTitle (t * testing.T ) {
25
- t .Run ("cute_Kitten" , func (t * testing.T ) {
32
+ t .Run ("Empty" , func (t * testing.T ) {
33
+ assert .Equal (t , "" , SlugToTitle ("" ))
34
+ })
35
+ t .Run ("Kitten" , func (t * testing.T ) {
26
36
assert .Equal (t , "Cute-Kitten" , SlugToTitle ("cute-kitten" ))
27
37
})
28
- t .Run ("empty" , func (t * testing.T ) {
29
- assert .Equal (t , "" , SlugToTitle ("" ))
38
+ t .Run ("Emoji" , func (t * testing.T ) {
39
+ assert .Equal (t , "💎" , SlugToTitle ("_5cpzfdq" ))
40
+ assert .Equal (t , "💐" , SlugToTitle ("_5cpzfea" ))
41
+ assert .Equal (t , "💎💐" , SlugToTitle ("_5cpzfdxqt5jja" ))
42
+ assert .Equal (t , "PhotoPrism" , SlugToTitle ("photoprism" ))
30
43
})
31
44
}
0 commit comments