MCPcopy
hub / github.com/andeya/pholcus / loadDoc

Function loadDoc

common/goquery/type_test.go:108–122  ·  view source on GitHub ↗
(page string)

Source from the content-addressed store, hash-verified

106}
107
108func loadDoc(page string) *Document {
109 var f *os.File
110 var e error
111
112 if f, e = os.Open(fmt.Sprintf("./testdata/%s", page)); e != nil {
113 panic(e.Error())
114 }
115 defer f.Close()
116
117 var node *html.Node
118 if node, e = html.Parse(f); e != nil {
119 panic(e.Error())
120 }
121 return NewDocumentFromNode(node)
122}
123
124func TestNewDocument(t *testing.T) {
125 if f, e := os.Open("./testdata/page.html"); e != nil {

Callers 6

DocFunction · 0.85
Doc2Function · 0.85
Doc3Function · 0.85
DocBFunction · 0.85
DocWFunction · 0.85

Calls 4

NewDocumentFromNodeFunction · 0.85
ErrorMethod · 0.65
CloseMethod · 0.65
ParseMethod · 0.45

Tested by

no test coverage detected