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

Function test_xpath_elements

xpath_test.go:43–54  ·  view source on GitHub ↗
(t *testing.T, root *TNode, expr string, expected ...int)

Source from the content-addressed store, hash-verified

41}
42
43func test_xpath_elements(t *testing.T, root *TNode, expr string, expected ...int) {
44 result := selectNodes(root, expr)
45
46 var gotLines []int
47 for i := 0; i < len(result); i++ {
48 gotLines = append(gotLines, result[i].lines)
49 }
50
51 if !reflect.DeepEqual(gotLines, expected) {
52 t.Fatalf("expected lines %+v, got %+v", expected, gotLines)
53 }
54}
55
56func test_xpath_values(t testing.TB, root *TNode, expr string, expected ...string) {
57 result := selectNodes(root, expr)

Callers 15

TestNamespacePrefixQueryFunction · 0.85
Test_selfFunction · 0.85
Test_childFunction · 0.85
Test_descendantFunction · 0.85
Test_descendant_or_selfFunction · 0.85
Test_ancestor_predicateFunction · 0.85
Test_ancestor_or_selfFunction · 0.85
Test_parentFunction · 0.85
Test_followingFunction · 0.85
Test_following_siblingFunction · 0.85
Test_precedingFunction · 0.85

Calls 1

selectNodesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…