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

Function Test_func_sum

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

Source from the content-addressed store, hash-verified

152}
153
154func Test_func_sum(t *testing.T) {
155 test_xpath_eval(t, empty_example, `sum(1 + 2)`, float64(3))
156 test_xpath_eval(t, empty_example, `sum(1.1 + 2)`, float64(3.1))
157 test_xpath_eval(t, book_example, `sum(//book/price)`, float64(149.93))
158 test_xpath_elements(t, book_example, `//book[sum(./price) > 40]`, 15)
159 assertPanic(t, func() { selectNode(html_example, `//title[sum('Hello') = 0]`) })
160}
161
162func Test_func_translate(t *testing.T) {
163 test_xpath_eval(t, empty_example, `translate("bar","abc","ABC")`, "BAr")

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…