MCPcopy Create free account
hub / github.com/antchfx/xpath / TestCompile

Function TestCompile

xpath_test.go:162–174  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

160}
161
162func TestCompile(t *testing.T) {
163 var err error
164 _, err = Compile("//a")
165 assertNil(t, err)
166 _, err = Compile("//a[id=']/span")
167 assertErr(t, err)
168 _, err = Compile("//ul/li/@class")
169 assertNil(t, err)
170 _, err = Compile("/a/b/(c, .[not(c)])")
171 assertNil(t, err)
172 _, err = Compile("/pre:foo")
173 assertNil(t, err)
174}
175
176func TestInvalidXPath(t *testing.T) {
177 var err error

Callers

nothing calls this directly

Calls 3

CompileFunction · 0.85
assertNilFunction · 0.85
assertErrFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…