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

Function Test_attribute

xpath_axes_test.go:101–110  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

99}
100
101func Test_attribute(t *testing.T) {
102 test_xpath_values(t, employee_example, `//attribute::id`, "1", "2", "3")
103 test_xpath_count(t, employee_example, `//attribute::*`, 9)
104
105 // test failed
106 //test_xpath_tags(t, employee_example, `//attribute::*[1]`, "id", "discipline", "id", "from", "discipline", "id", "discipline")
107 // test failed(random): the return values is expected but the order of value is random.
108 //test_xpath_tags(t, employee_example, `//attribute::*`, "id", "discipline", "experience", "id", "from", "discipline", "experience", "id", "discipline")
109
110}
111
112func Test_following(t *testing.T) {
113 test_xpath_elements(t, employee_example, `//employee[@id=1]/following::*`, 8, 9, 10, 11, 13, 14, 15, 16)

Callers

nothing calls this directly

Calls 2

test_xpath_valuesFunction · 0.85
test_xpath_countFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…