(b *testing.B)
| 90 | } |
| 91 | |
| 92 | func BenchmarkIndexOfNode(b *testing.B) { |
| 93 | var j int |
| 94 | |
| 95 | b.StopTimer() |
| 96 | sel := DocB().Find("span a") |
| 97 | sel2 := DocB().Find("span a:nth-child(3)") |
| 98 | n := sel2.Get(0) |
| 99 | b.StartTimer() |
| 100 | for i := 0; i < b.N; i++ { |
| 101 | j = sel.IndexOfNode(n) |
| 102 | } |
| 103 | if j != 2 { |
| 104 | b.Fatalf("want 2, got %d", j) |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | func BenchmarkIndexOfSelection(b *testing.B) { |
| 109 | var j int |
nothing calls this directly
no test coverage detected