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

Function Test_func_contains

xpath_function_test.go:50–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

48}
49
50func Test_func_contains(t *testing.T) {
51 test_xpath_eval(t, empty_example, `contains("tattoo", "t")`, true)
52 test_xpath_eval(t, empty_example, `contains("tattoo", "T")`, false)
53 test_xpath_eval(t, empty_example, `contains("tattoo", "ttt")`, false)
54 //test_xpath_eval(t, empty_example, `contains("", ())`, true)
55 test_xpath_elements(t, book_example, `//book[contains(title, "Potter")]`, 9)
56 test_xpath_elements(t, book_example, `//book[contains(year, "2005")]`, 3, 9)
57 assertPanic(t, func() { selectNode(html_example, "//*[contains(0, 0)]") })
58}
59
60func Test_func_count(t *testing.T) {
61 test_xpath_eval(t, book_example, `count(//book)`, float64(4))

Callers

nothing calls this directly

Calls 4

test_xpath_evalFunction · 0.85
test_xpath_elementsFunction · 0.85
assertPanicFunction · 0.85
selectNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…