(t *testing.T, root *TNode, expr string, expected ...int)
| 41 | } |
| 42 | |
| 43 | func 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 | |
| 56 | func test_xpath_values(t testing.TB, root *TNode, expr string, expected ...string) { |
| 57 | result := selectNodes(root, expr) |
no test coverage detected
searching dependent graphs…