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

Function Test_func_string_empty

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

Source from the content-addressed store, hash-verified

101 test_xpath_eval(t, book_example, `string(//book/@category)`, "cooking")
102}
103func Test_func_string_empty(t *testing.T) {
104 // https://github.com/antchfx/xpath/issues/113
105 // Create the equivalent of <div>hi</div> using TNode
106 doc := createNode("", RootNode)
107 div := doc.createChildNode("div", ElementNode)
108 div.lines = 1 // Assign a line number for the test helper
109 div.createChildNode("hi", TextNode)
110
111 // Use the existing test helper to evaluate the XPath
112 // The expression selects the div if its string value ("hi") is true in a boolean context.
113 test_xpath_values(t, doc, `//div[string()]`, "hi")
114}
115
116func Test_func_string_join(t *testing.T) {
117 //(t, empty_example, `string-join(('Now', 'is', 'the', 'time', '...'), '')`, "Now is the time ...")

Callers

nothing calls this directly

Calls 3

createNodeFunction · 0.85
test_xpath_valuesFunction · 0.85
createChildNodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…