(t *testing.T)
| 51 | } |
| 52 | |
| 53 | func TestFetchExcerpt(t *testing.T) { |
| 54 | var ( |
| 55 | expected, |
| 56 | text string |
| 57 | ) |
| 58 | |
| 59 | // test english string |
| 60 | expected = "hello..." |
| 61 | text = FetchExcerpt("<p>hello world</p>", "...", 5) |
| 62 | assert.Equal(t, expected, text) |
| 63 | |
| 64 | // test mixed string |
| 65 | expected = "hello你好..." |
| 66 | text = FetchExcerpt("<p>hello你好world</p>", "...", 7) |
| 67 | assert.Equal(t, expected, text) |
| 68 | |
| 69 | // test mixed string with emoticon |
| 70 | expected = "hello你好😂..." |
| 71 | text = FetchExcerpt("<p>hello你好😂world</p>", "...", 8) |
| 72 | assert.Equal(t, expected, text) |
| 73 | |
| 74 | expected = "hello你好" |
| 75 | text = FetchExcerpt("<p>hello你好</p>", "...", 8) |
| 76 | assert.Equal(t, expected, text) |
| 77 | } |
| 78 | |
| 79 | func TestUrlTitle(t *testing.T) { |
| 80 | list := []string{ |
nothing calls this directly
no test coverage detected