mirror of
https://github.com/usememos/memos.git
synced 2025-09-30 17:45:49 +08:00
chore: update tests (#572)
This commit is contained in:
parent
f4e2b7319a
commit
29880be283
2 changed files with 8 additions and 6 deletions
|
@ -11,12 +11,6 @@ func TestGetHTMLMeta(t *testing.T) {
|
||||||
urlStr string
|
urlStr string
|
||||||
htmlMeta HTMLMeta
|
htmlMeta HTMLMeta
|
||||||
}{
|
}{
|
||||||
{
|
|
||||||
urlStr: "https://baidu.com",
|
|
||||||
htmlMeta: HTMLMeta{
|
|
||||||
Title: "百度一下,你就知道",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
urlStr: "https://www.bytebase.com/blog/sql-review-tool-for-devs",
|
urlStr: "https://www.bytebase.com/blog/sql-review-tool-for-devs",
|
||||||
htmlMeta: HTMLMeta{
|
htmlMeta: HTMLMeta{
|
||||||
|
|
|
@ -29,6 +29,14 @@ func TestFindTagListFromMemoContent(t *testing.T) {
|
||||||
memoContent: "#tag1 #tag2 \n#tag3 #tag4 ",
|
memoContent: "#tag1 #tag2 \n#tag3 #tag4 ",
|
||||||
want: []string{"tag1", "tag2", "tag3", "tag4"},
|
want: []string{"tag1", "tag2", "tag3", "tag4"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
memoContent: "#tag1 123123#tag2 \n#tag3 #tag4 ",
|
||||||
|
want: []string{"tag1", "tag3", "tag4"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
memoContent: "#tag1 http://123123.com?123123#tag2 \n#tag3 #tag4 http://123123.com?123123#tag2) ",
|
||||||
|
want: []string{"tag1", "tag3", "tag4"},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
result := findTagListFromMemoContent(test.memoContent)
|
result := findTagListFromMemoContent(test.memoContent)
|
||||||
|
|
Loading…
Add table
Reference in a new issue