(b *testing.B)
| 538 | } |
| 539 | |
| 540 | func BenchmarkNextUntilSelection(b *testing.B) { |
| 541 | var n int |
| 542 | |
| 543 | b.StopTimer() |
| 544 | sel := DocW().Find("h2") |
| 545 | sel2 := DocW().Find("ul") |
| 546 | b.StartTimer() |
| 547 | for i := 0; i < b.N; i++ { |
| 548 | if n == 0 { |
| 549 | n = sel.NextUntilSelection(sel2).Length() |
| 550 | } else { |
| 551 | sel.NextUntilSelection(sel2) |
| 552 | } |
| 553 | } |
| 554 | if n != 42 { |
| 555 | b.Fatalf("want 42, got %d", n) |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | func BenchmarkNextUntilNodes(b *testing.B) { |
| 560 | var n int |
nothing calls this directly
no test coverage detected
searching dependent graphs…