(t *testing.T)
| 184 | } |
| 185 | |
| 186 | func Test_func_number(t *testing.T) { |
| 187 | test_xpath_eval(t, empty_example, `number(10)`, float64(10)) |
| 188 | test_xpath_eval(t, empty_example, `number(1.11)`, float64(1.11)) |
| 189 | test_xpath_eval(t, empty_example, `number("10") > 10`, false) |
| 190 | test_xpath_eval(t, empty_example, `number("10") = 10`, true) |
| 191 | test_xpath_eval(t, empty_example, `number("123") < 1000`, true) |
| 192 | test_xpath_eval(t, empty_example, `number(//non-existent-node) = 0`, false) |
| 193 | assertTrue(t, math.IsNaN(MustCompile(`number(//non-existent-node)`).Evaluate(createNavigator(empty_example)).(float64))) |
| 194 | assertTrue(t, math.IsNaN(MustCompile(`number("123a")`).Evaluate(createNavigator(empty_example)).(float64))) |
| 195 | } |
| 196 | |
| 197 | func Test_func_position(t *testing.T) { |
| 198 | test_xpath_elements(t, book_example, `//book[position() = 1]`, 3) |
nothing calls this directly
no test coverage detected
searching dependent graphs…