Some test examples from http://zvon.org/comp/r/ref-XPath_2.html
(t *testing.T)
| 8 | // Some test examples from http://zvon.org/comp/r/ref-XPath_2.html |
| 9 | |
| 10 | func 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 | |
| 23 | func Test_func_name(t *testing.T) { |
| 24 | test_xpath_eval(t, html_example, `name(//html/@lang)`, "lang") |
nothing calls this directly
no test coverage detected
searching dependent graphs…