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

Function Test_func_normalize_space

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

Source from the content-addressed store, hash-verified

241}
242
243func Test_func_normalize_space(t *testing.T) {
244 const testStr = "\t \rloooooooonnnnnnngggggggg \r \n tes \u00a0 t strin \n\n \r g "
245 const expectedStr = `loooooooonnnnnnngggggggg tes t strin g`
246 test_xpath_eval(t, empty_example, `normalize-space("`+testStr+`")`, expectedStr)
247 test_xpath_eval(t, empty_example, `normalize-space(' abc ')`, "abc")
248 n := selectNode(employee_example, `//employee[@id="1"]/name`)
249 test_xpath_eval(t, n, `normalize-space()`, "Opal Kole")
250 test_xpath_eval(t, n, `normalize-space(.)`, "Opal Kole")
251 test_xpath_eval(t, book_example, `normalize-space(//book/title)`, "Everyday Italian")
252 test_xpath_eval(t, book_example, `normalize-space(//book[1]/title)`, "Everyday Italian")
253
254}
255
256func Test_func_lower_case(t *testing.T) {
257 test_xpath_eval(t, empty_example, `lower-case("ABc!D")`, "abc!d")

Callers

nothing calls this directly

Calls 2

test_xpath_evalFunction · 0.85
selectNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…