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

Function Test_func_boolean

xpath_function_test.go:10–21  ·  view source on GitHub ↗

Some test examples from http://zvon.org/comp/r/ref-XPath_2.html

(t *testing.T)

Source from the content-addressed store, hash-verified

8// Some test examples from http://zvon.org/comp/r/ref-XPath_2.html
9
10func Test_func_boolean(t *testing.T) {
11 test_xpath_eval(t, empty_example, `true()`, true)
12 test_xpath_eval(t, empty_example, `false()`, false)
13 test_xpath_eval(t, empty_example, `boolean(0)`, false)
14 test_xpath_eval(t, empty_example, `boolean(null)`, false)
15 test_xpath_eval(t, empty_example, `boolean(1)`, true)
16 test_xpath_eval(t, empty_example, `boolean(2)`, true)
17 test_xpath_eval(t, empty_example, `boolean(true)`, false)
18 test_xpath_eval(t, empty_example, `boolean(1 > 2)`, false)
19 test_xpath_eval(t, book_example, `boolean(//*[@lang])`, true)
20 test_xpath_eval(t, book_example, `boolean(//*[@x])`, false)
21}
22
23func Test_func_name(t *testing.T) {
24 test_xpath_eval(t, html_example, `name(//html/@lang)`, "lang")

Callers

nothing calls this directly

Calls 1

test_xpath_evalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…