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

Function Test_func_ends_with

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

Source from the content-addressed store, hash-verified

63}
64
65func Test_func_ends_with(t *testing.T) {
66 test_xpath_eval(t, empty_example, `ends-with("tattoo", "tattoo")`, true)
67 test_xpath_eval(t, empty_example, `ends-with("tattoo", "atto")`, false)
68 test_xpath_elements(t, book_example, `//book[ends-with(@category,'ing')]`, 3)
69 test_xpath_elements(t, book_example, `//book[ends-with(./price,'.99')]`, 9, 15)
70 assertPanic(t, func() { selectNode(html_example, `//*[ends-with(0, 0)]`) }) // arg must be start with string
71 assertPanic(t, func() { selectNode(html_example, `//*[ends-with(name(), 0)]`) })
72}
73
74func Test_func_last(t *testing.T) {
75 test_xpath_elements(t, book_example, `//bookstore[last()]`, 2)

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…