add Text() with tests.

This commit is contained in:
Martin Angers
2012-09-01 10:45:47 -04:00
parent e42c4fb35e
commit 6b36d629f0
3 changed files with 64 additions and 0 deletions

View File

@@ -28,6 +28,17 @@ func EnsureDocLoaded() {
}
}
func printNode(n *html.Node, t *testing.T) {
t.Logf("Type: %v, Data: %v\n", n.Type, n.Data)
for _, c := range n.Child {
printNode(c, t)
}
}
func TestPrintAll(t *testing.T) {
//printNode(Doc().Root, t)
}
func TestNewDocument(t *testing.T) {
if f, e := os.Open("./testdata/page.html"); e != nil {
t.Error(e.Error())