mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-04 13:52:26 +08:00
update
This commit is contained in:
18
db_test.go
18
db_test.go
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"html/template"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -42,3 +43,20 @@ func TestAddSerie(t *testing.T) {
|
|||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRenderPage(t *testing.T) {
|
||||||
|
data := []byte(`<ul class="links ssl">
|
||||||
|
<li><a href="https://yryz.net/">一人游走</a><span class="date">「不错的小伙子」</span></li>
|
||||||
|
<li><a href="https://hsulei.com/">Leo同学</a><span class="date">「小伙子,该干活了」</span></li>
|
||||||
|
<li><a href="https://razeencheng.com/">razeen同学</a><span class="date">「Stay hungry. Stay foolish.」</span></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul class="links">
|
||||||
|
<li><a href="http://blog.mirreal.net/">Mirreal Ellison</a><span class="date">「kissing the fire」</span></li>
|
||||||
|
</ul>`)
|
||||||
|
|
||||||
|
t.Log(IgnoreHtmlTag(string(data)))
|
||||||
|
data = renderPage(data)
|
||||||
|
|
||||||
|
t.Log(template.HTML(string(data)))
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user