mirror of
https://github.com/PuerkitoBio/goquery.git
synced 2024-04-21 12:31:36 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f065786d41 | ||
|
|
e8c0a63721 | ||
|
|
263b827b20 | ||
|
|
2d2b626f0d | ||
|
|
8a4ef5dbdd | ||
|
|
948b88c36f | ||
|
|
27b24066a6 | ||
|
|
485b1f5575 | ||
|
|
0d8bcaa448 | ||
|
|
d49fa5b2a1 | ||
|
|
d84f346f92 | ||
|
|
f5309e0304 | ||
|
|
4bdceda6d8 | ||
|
|
fd221b178b | ||
|
|
ee5503bf12 | ||
|
|
474b169363 | ||
|
|
a28d5edf42 | ||
|
|
7f5775caed | ||
|
|
b26e04175c | ||
|
|
6948b1bfac | ||
|
|
f98d0dce50 | ||
|
|
971be3c4e4 | ||
|
|
2f94000c0a | ||
|
|
0f850e5c82 | ||
|
|
ae1a71636e | ||
|
|
6669ef001f | ||
|
|
cbddb7a808 | ||
|
|
9ed3dce6b0 | ||
|
|
1f8447feb6 | ||
|
|
2371acd273 | ||
|
|
d239ff0ac3 | ||
|
|
7ab40af0ae | ||
|
|
c5da811875 | ||
|
|
69bd580cd4 | ||
|
|
b358595af5 | ||
|
|
52823e89b9 | ||
|
|
b79d2572e6 | ||
|
|
6c7e98359b | ||
|
|
23a9e4d290 | ||
|
|
30f50b483f | ||
|
|
489bc34355 | ||
|
|
34ebfb6ebc | ||
|
|
f0e21587c8 | ||
|
|
7b5bdc108a |
@@ -1,2 +1,5 @@
|
||||
*.sublime-*
|
||||
.DS_Store
|
||||
*.swp
|
||||
#*.*#
|
||||
tags
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2012, Martin Angers & Contributors
|
||||
Copyright (c) 2012-2013, Martin Angers & Contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# goquery - a little like that j-thing, only in Go
|
||||
|
||||
GoQuery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on the [experimental html package][exphtml] and the CSS Selector library [cascadia][]. Since the experimental html parser returns tokens (nodes), and not a full-featured DOM object, jQuery's manipulation and modification functions have been left off (no point in modifying data in the parsed tree of the HTML, it has no effect).
|
||||
GoQuery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on the experimental html package and the CSS Selector library [cascadia][]. Since the experimental html parser returns tokens (nodes), and not a full-featured DOM object, jQuery's manipulation and modification functions have been left off (no point in modifying data in the parsed tree of the HTML, it has no effect).
|
||||
|
||||
Supported functions are query-oriented features (`hasClass()`, `attr()` and the likes), as well as traversing functions that make sense given what we have to work with. This makes GoQuery a great library for scraping web pages.
|
||||
|
||||
@@ -8,15 +8,27 @@ Syntax-wise, it is as close as possible to jQuery, with the same function names
|
||||
|
||||
## Installation
|
||||
|
||||
Since this library (and cascadia) depends on the experimental branch, this package must be installed first. Both GoQuery and Cascadia expect to find the experimental library with the `"exp/html"` import statement. To install it at this location, please [follow this guide][wikiexp].
|
||||
$ go get github.com/PuerkitoBio/goquery
|
||||
|
||||
Once this is done, install GoQuery:
|
||||
(optional) To run unit tests:
|
||||
|
||||
$ cd $GOPATH/src/github.com/PuerkitoBio/goquery
|
||||
$ go test
|
||||
|
||||
`go get github.com/PuerkitoBio/goquery`
|
||||
(optional) To run benchmarks:
|
||||
|
||||
$ cd $GOPATH/src/github.com/PuerkitoBio/goquery
|
||||
$ go test -bench=".*"
|
||||
|
||||
## Changelog
|
||||
|
||||
* **v0.1** : Initial release. See <a href="#a1">TODOs</a> for a list of upcoming features.
|
||||
* **v0.3.2** : Add `NewDocumentFromReader()` (thanks jweir) which allows creating a goquery document from an io.Reader.
|
||||
* **v0.3.1** : Add `NewDocumentFromResponse()` (thanks assassingj) which allows creating a goquery document from an http response.
|
||||
* **v0.3.0** : Add `EachWithBreak()` which allows to break out of an `Each()` loop by returning false. This function was added instead of changing the existing `Each()` to avoid breaking compatibility.
|
||||
* **v0.2.1** : Make go-getable, now that [go.net/html is Go1.0-compatible][gonet] (thanks to @matrixik for pointing this out).
|
||||
* **v0.2.0** : Add support for negative indices in Slice(). **BREAKING CHANGE** `Document.Root` is removed, `Document` is now a `Selection` itself (a selection of one, the root element, just like `Document.Root` was before). Add jQuery's Closest() method.
|
||||
* **v0.1.1** : Add benchmarks to use as baseline for refactorings, refactor Next...() and Prev...() methods to use the new html package's linked list features (Next/PrevSibling, FirstChild). Good performance boost (40+% in some cases).
|
||||
* **v0.1.0** : Initial release.
|
||||
|
||||
## API
|
||||
|
||||
@@ -38,55 +50,49 @@ Please note that Cascadia's selectors do NOT necessarily match all supported sel
|
||||
|
||||
Taken from example_test.go:
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
// In real use, this import would be required (not in this example, since it
|
||||
// is part of the goquery package)
|
||||
//"github.com/PuerkitoBio/goquery"
|
||||
"strconv"
|
||||
)
|
||||
```Go
|
||||
import (
|
||||
"fmt"
|
||||
// In real use, this import would be required (not in this example, since it
|
||||
// is part of the goquery package)
|
||||
//"github.com/PuerkitoBio/goquery"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// This example scrapes the 10 reviews shown on the home page of MetalReview.com,
|
||||
// the best metal review site on the web :) (and no, I'm not affiliated to them!)
|
||||
func ExampleScrape_MetalReview() {
|
||||
// Load the HTML document (in real use, the type would be *goquery.Document)
|
||||
var doc *Document
|
||||
var e error
|
||||
if doc, e = NewDocument("http://metalreview.com"); e != nil {
|
||||
panic(e.Error())
|
||||
}
|
||||
// This example scrapes the 10 reviews shown on the home page of MetalReview.com,
|
||||
// the best metal review site on the web :) (and no, I'm not affiliated to them!)
|
||||
func ExampleScrape_MetalReview() {
|
||||
// Load the HTML document (in real use, the type would be *goquery.Document)
|
||||
var doc *Document
|
||||
var e error
|
||||
|
||||
// Find the review items (the type of the Selection would be *goquery.Selection)
|
||||
doc.Root.Find(".slider-row:nth-child(1) .slider-item").Each(func(i int, s *Selection) {
|
||||
var band, title string
|
||||
var score float64
|
||||
if doc, e = NewDocument("http://metalreview.com"); e != nil {
|
||||
panic(e.Error())
|
||||
}
|
||||
|
||||
// For each item found, get the band, title and score, and print it
|
||||
band = s.Find("strong").Text()
|
||||
title = s.Find("em").Text()
|
||||
if score, e = strconv.ParseFloat(s.Find(".score").Text(), 64); e != nil {
|
||||
// Not a valid float, ignore score
|
||||
fmt.Printf("Review %d: %s - %s.\n", i, band, title)
|
||||
} else {
|
||||
// Print all, including score
|
||||
fmt.Printf("Review %d: %s - %s (%2.1f).\n", i, band, title, score)
|
||||
}
|
||||
})
|
||||
// To see the output of the Example while running the test suite (go test), simply
|
||||
// remove the leading "x" before Output on the next line. This will cause the
|
||||
// example to fail (all the "real" tests should pass).
|
||||
// Find the review items (the type of the Selection would be *goquery.Selection)
|
||||
doc.Find(".slider-row:nth-child(1) .slider-item").Each(func(i int, s *Selection) {
|
||||
var band, title string
|
||||
var score float64
|
||||
|
||||
// xOutput: voluntarily fail the Example output.
|
||||
// For each item found, get the band, title and score, and print it
|
||||
band = s.Find("strong").Text()
|
||||
title = s.Find("em").Text()
|
||||
if score, e = strconv.ParseFloat(s.Find(".score").Text(), 64); e != nil {
|
||||
// Not a valid float, ignore score
|
||||
fmt.Printf("Review %d: %s - %s.\n", i, band, title)
|
||||
} else {
|
||||
// Print all, including score
|
||||
fmt.Printf("Review %d: %s - %s (%2.1f).\n", i, band, title, score)
|
||||
}
|
||||
})
|
||||
// To see the output of the Example while running the test suite (go test), simply
|
||||
// remove the leading "x" before Output on the next line. This will cause the
|
||||
// example to fail (all the "real" tests should pass).
|
||||
|
||||
|
||||
## TODOs
|
||||
<a id="a1"></a>
|
||||
|
||||
* Benchmarks so that future changes have a baseline to compare to.
|
||||
* Refactor Next...() and Prev...() to use the new NextSibling/PrevSibling fields.
|
||||
* Add jQuery's `Closest()`? Other missing functions?
|
||||
* Support negative indices in `Slice()`, like jQuery.
|
||||
// xOutput: voluntarily fail the Example output.
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
@@ -94,11 +100,10 @@ The [BSD 3-Clause license][bsd], the same as the [Go language][golic]. Cascadia'
|
||||
|
||||
[jquery]: http://jquery.com/
|
||||
[go]: http://golang.org/
|
||||
[exphtml]: http://code.google.com/p/go/source/browse#hg%2Fsrc%2Fpkg%2Fexp
|
||||
[cascadia]: http://code.google.com/p/cascadia/
|
||||
[wikiexp]: http://code.google.com/p/go-wiki/wiki/InstallingExp
|
||||
[bsd]: http://opensource.org/licenses/BSD-3-Clause
|
||||
[golic]: http://golang.org/LICENSE
|
||||
[caslic]: http://code.google.com/p/cascadia/source/browse/LICENSE
|
||||
[doc]: http://go.pkgdoc.org/github.com/puerkitobio/goquery
|
||||
[doc]: http://godoc.org/github.com/PuerkitoBio/goquery
|
||||
[index]: http://api.jquery.com/index/
|
||||
[gonet]: http://code.google.com/p/go/source/detail?r=f7f5159120f51ba0070774d3c5907969b5fe7858&repo=net
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"exp/html"
|
||||
"code.google.com/p/go.net/html"
|
||||
)
|
||||
|
||||
// First() reduces the set of matched elements to the first in the set.
|
||||
@@ -28,9 +28,14 @@ func (this *Selection) Eq(index int) *Selection {
|
||||
}
|
||||
|
||||
// Slice() reduces the set of matched elements to a subset specified by a range
|
||||
// of indices. At the moment, negative indices are not supported.
|
||||
// of indices.
|
||||
func (this *Selection) Slice(start int, end int) *Selection {
|
||||
// TODO : Negative indices, like jQuery
|
||||
if start < 0 {
|
||||
start += len(this.Nodes)
|
||||
}
|
||||
if end < 0 {
|
||||
end += len(this.Nodes)
|
||||
}
|
||||
return pushStack(this, this.Nodes[start:end])
|
||||
}
|
||||
|
||||
@@ -58,7 +63,7 @@ func (this *Selection) Index() int {
|
||||
// not found.
|
||||
func (this *Selection) IndexSelector(selector string) int {
|
||||
if len(this.Nodes) > 0 {
|
||||
sel := this.document.Root.Find(selector)
|
||||
sel := this.document.Find(selector)
|
||||
return indexInSlice(sel.Nodes, this.Nodes[0])
|
||||
}
|
||||
return -1
|
||||
|
||||
+47
-22
@@ -5,79 +5,104 @@ import (
|
||||
)
|
||||
|
||||
func TestFirst(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content").First()
|
||||
sel := Doc().Find(".pvk-content").First()
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestFirstEmpty(t *testing.T) {
|
||||
defer AssertPanic(t)
|
||||
Doc().Root.Find(".pvk-zzcontentzz").First()
|
||||
Doc().Find(".pvk-zzcontentzz").First()
|
||||
}
|
||||
|
||||
func TestFirstRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.First().End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestLast(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content").Last()
|
||||
sel := Doc().Find(".pvk-content").Last()
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
|
||||
// Should contain Footer
|
||||
foot := Doc().Root.Find(".footer")
|
||||
foot := Doc().Find(".footer")
|
||||
if !sel.Contains(foot.Nodes[0]) {
|
||||
t.Error("Last .pvk-content should contain .footer.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLastRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Last().End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestEq(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content").Eq(1)
|
||||
sel := Doc().Find(".pvk-content").Eq(1)
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestEqNegative(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content").Eq(-1)
|
||||
sel := Doc().Find(".pvk-content").Eq(-1)
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
|
||||
// Should contain Footer
|
||||
foot := Doc().Root.Find(".footer")
|
||||
foot := Doc().Find(".footer")
|
||||
if !sel.Contains(foot.Nodes[0]) {
|
||||
t.Error("Index -1 of .pvk-content should contain .footer.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestEqRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Eq(1).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestSlice(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content").Slice(0, 2)
|
||||
sel := Doc().Find(".pvk-content").Slice(0, 2)
|
||||
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
}
|
||||
|
||||
func TestSliceOutOfBounds(t *testing.T) {
|
||||
defer AssertPanic(t)
|
||||
Doc().Root.Find(".pvk-content").Slice(2, 12)
|
||||
Doc().Find(".pvk-content").Slice(2, 12)
|
||||
}
|
||||
|
||||
func TestNegativeSliceStart(t *testing.T) {
|
||||
sel := Doc().Find(".container-fluid").Slice(-2, 3)
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
AssertSelectionIs(t, sel.Eq(0), "#cf3")
|
||||
}
|
||||
|
||||
func TestNegativeSliceEnd(t *testing.T) {
|
||||
sel := Doc().Find(".container-fluid").Slice(1, -1)
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
AssertSelectionIs(t, sel.Eq(0), "#cf2")
|
||||
AssertSelectionIs(t, sel.Eq(1), "#cf3")
|
||||
}
|
||||
|
||||
func TestNegativeSliceBoth(t *testing.T) {
|
||||
sel := Doc().Find(".container-fluid").Slice(-3, -1)
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
AssertSelectionIs(t, sel.Eq(0), "#cf2")
|
||||
AssertSelectionIs(t, sel.Eq(1), "#cf3")
|
||||
}
|
||||
|
||||
func TestNegativeSliceOutOfBounds(t *testing.T) {
|
||||
defer AssertPanic(t)
|
||||
Doc().Find(".container-fluid").Slice(-12, -7)
|
||||
}
|
||||
|
||||
func TestSliceRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Slice(0, 2).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestGet(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
node := sel.Get(1)
|
||||
if sel.Nodes[1] != node {
|
||||
t.Errorf("Expected node %v to be %v.", node, sel.Nodes[1])
|
||||
@@ -85,7 +110,7 @@ func TestGet(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetNegative(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
node := sel.Get(-3)
|
||||
if sel.Nodes[0] != node {
|
||||
t.Errorf("Expected node %v to be %v.", node, sel.Nodes[0])
|
||||
@@ -94,41 +119,41 @@ func TestGetNegative(t *testing.T) {
|
||||
|
||||
func TestGetInvalid(t *testing.T) {
|
||||
defer AssertPanic(t)
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel.Get(129)
|
||||
}
|
||||
|
||||
func TestIndex(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
if i := sel.Index(); i != 1 {
|
||||
t.Errorf("Expected index of 1, got %v.", i)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIndexSelector(t *testing.T) {
|
||||
sel := Doc().Root.Find(".hero-unit")
|
||||
sel := Doc().Find(".hero-unit")
|
||||
if i := sel.IndexSelector("div"); i != 4 {
|
||||
t.Errorf("Expected index of 4, got %v.", i)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIndexOfNode(t *testing.T) {
|
||||
sel := Doc().Root.Find("div.pvk-gutter")
|
||||
sel := Doc().Find("div.pvk-gutter")
|
||||
if i := sel.IndexOfNode(sel.Nodes[1]); i != 1 {
|
||||
t.Errorf("Expected index of 1, got %v.", i)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIndexOfNilNode(t *testing.T) {
|
||||
sel := Doc().Root.Find("div.pvk-gutter")
|
||||
sel := Doc().Find("div.pvk-gutter")
|
||||
if i := sel.IndexOfNode(nil); i != -1 {
|
||||
t.Errorf("Expected index of -1, got %v.", i)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIndexOfSelection(t *testing.T) {
|
||||
sel := Doc().Root.Find("div")
|
||||
sel2 := Doc().Root.Find(".hero-unit")
|
||||
sel := Doc().Find("div")
|
||||
sel2 := Doc().Find(".hero-unit")
|
||||
if i := sel.IndexOfSelection(sel2); i != 4 {
|
||||
t.Errorf("Expected index of 4, got %v.", i)
|
||||
}
|
||||
|
||||
+436
@@ -0,0 +1,436 @@
|
||||
PASS
|
||||
BenchmarkFirst 20000000 92.9 ns/op
|
||||
BenchmarkLast 20000000 91.6 ns/op
|
||||
BenchmarkEq 20000000 90.6 ns/op
|
||||
BenchmarkSlice 20000000 86.7 ns/op
|
||||
BenchmarkGet 1000000000 2.14 ns/op
|
||||
BenchmarkIndex 500000 5308 ns/op
|
||||
--- BENCH: BenchmarkIndex
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
BenchmarkIndexSelector 50000 54962 ns/op
|
||||
--- BENCH: BenchmarkIndexSelector
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
BenchmarkIndexOfNode 100000000 11.4 ns/op
|
||||
--- BENCH: BenchmarkIndexOfNode
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
BenchmarkIndexOfSelection 100000000 12.1 ns/op
|
||||
--- BENCH: BenchmarkIndexOfSelection
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
BenchmarkMetalReviewExample 5000 327144 ns/op
|
||||
--- BENCH: BenchmarkMetalReviewExample
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
|
||||
bench_example_test.go:41: MetalReviewExample=10
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
... [output truncated]
|
||||
BenchmarkAdd 50000 52945 ns/op
|
||||
--- BENCH: BenchmarkAdd
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
BenchmarkAddSelection 10000000 205 ns/op
|
||||
--- BENCH: BenchmarkAddSelection
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
BenchmarkAddNodes 10000000 203 ns/op
|
||||
--- BENCH: BenchmarkAddNodes
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
BenchmarkAndSelf 1000000 2639 ns/op
|
||||
--- BENCH: BenchmarkAndSelf
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
BenchmarkFilter 50000 30182 ns/op
|
||||
--- BENCH: BenchmarkFilter
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
BenchmarkNot 50000 34855 ns/op
|
||||
--- BENCH: BenchmarkNot
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
BenchmarkFilterFunction 50000 66052 ns/op
|
||||
--- BENCH: BenchmarkFilterFunction
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
BenchmarkNotFunction 50000 69721 ns/op
|
||||
--- BENCH: BenchmarkNotFunction
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
BenchmarkFilterNodes 50000 66077 ns/op
|
||||
--- BENCH: BenchmarkFilterNodes
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
BenchmarkNotNodes 20000 80021 ns/op
|
||||
--- BENCH: BenchmarkNotNodes
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
BenchmarkFilterSelection 50000 66256 ns/op
|
||||
--- BENCH: BenchmarkFilterSelection
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
BenchmarkNotSelection 20000 79568 ns/op
|
||||
--- BENCH: BenchmarkNotSelection
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
BenchmarkHas 5000 569441 ns/op
|
||||
--- BENCH: BenchmarkHas
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
BenchmarkHasNodes 10000 230585 ns/op
|
||||
--- BENCH: BenchmarkHasNodes
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
BenchmarkHasSelection 10000 231470 ns/op
|
||||
--- BENCH: BenchmarkHasSelection
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
BenchmarkEnd 500000000 4.65 ns/op
|
||||
--- BENCH: BenchmarkEnd
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
BenchmarkEach 200000 9558 ns/op
|
||||
--- BENCH: BenchmarkEach
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
BenchmarkMap 100000 16809 ns/op
|
||||
--- BENCH: BenchmarkMap
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
BenchmarkAttr 50000000 37.5 ns/op
|
||||
--- BENCH: BenchmarkAttr
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
BenchmarkText 100000 18583 ns/op
|
||||
BenchmarkLength 2000000000 0.80 ns/op
|
||||
--- BENCH: BenchmarkLength
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
BenchmarkHtml 5000000 666 ns/op
|
||||
BenchmarkIs 50000 34328 ns/op
|
||||
--- BENCH: BenchmarkIs
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
BenchmarkIsPositional 50000 32423 ns/op
|
||||
--- BENCH: BenchmarkIsPositional
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
BenchmarkIsFunction 1000000 2707 ns/op
|
||||
--- BENCH: BenchmarkIsFunction
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
BenchmarkIsSelection 50000 66976 ns/op
|
||||
--- BENCH: BenchmarkIsSelection
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
BenchmarkIsNodes 50000 66740 ns/op
|
||||
--- BENCH: BenchmarkIsNodes
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
BenchmarkHasClass 5000 701722 ns/op
|
||||
--- BENCH: BenchmarkHasClass
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
BenchmarkContains 100000000 11.9 ns/op
|
||||
--- BENCH: BenchmarkContains
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
BenchmarkFind 50000 55444 ns/op
|
||||
--- BENCH: BenchmarkFind
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
BenchmarkFindWithinSelection 10000 127984 ns/op
|
||||
--- BENCH: BenchmarkFindWithinSelection
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
BenchmarkFindSelection 5000 355944 ns/op
|
||||
--- BENCH: BenchmarkFindSelection
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
BenchmarkFindNodes 5000 355596 ns/op
|
||||
--- BENCH: BenchmarkFindNodes
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
BenchmarkContents 500000 5656 ns/op
|
||||
--- BENCH: BenchmarkContents
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
BenchmarkContentsFiltered 200000 9007 ns/op
|
||||
--- BENCH: BenchmarkContentsFiltered
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
BenchmarkChildren 1000000 1237 ns/op
|
||||
--- BENCH: BenchmarkChildren
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
BenchmarkChildrenFiltered 500000 5613 ns/op
|
||||
--- BENCH: BenchmarkChildrenFiltered
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
BenchmarkParent 50000 47026 ns/op
|
||||
--- BENCH: BenchmarkParent
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
BenchmarkParentFiltered 50000 51438 ns/op
|
||||
--- BENCH: BenchmarkParentFiltered
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
BenchmarkParents 20000 91820 ns/op
|
||||
--- BENCH: BenchmarkParents
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
BenchmarkParentsFiltered 20000 95156 ns/op
|
||||
--- BENCH: BenchmarkParentsFiltered
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
BenchmarkParentsUntil 10000 134383 ns/op
|
||||
--- BENCH: BenchmarkParentsUntil
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
BenchmarkParentsUntilSelection 10000 235456 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilSelection
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
BenchmarkParentsUntilNodes 10000 235936 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilNodes
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
BenchmarkParentsFilteredUntil 50000 32451 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntil
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
BenchmarkParentsFilteredUntilSelection 50000 30570 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilSelection
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
BenchmarkParentsFilteredUntilNodes 50000 30729 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilNodes
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
BenchmarkSiblings 10000 106704 ns/op
|
||||
--- BENCH: BenchmarkSiblings
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
BenchmarkSiblingsFiltered 10000 115592 ns/op
|
||||
--- BENCH: BenchmarkSiblingsFiltered
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
BenchmarkNext 50000 54449 ns/op
|
||||
--- BENCH: BenchmarkNext
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
BenchmarkNextFiltered 50000 58503 ns/op
|
||||
--- BENCH: BenchmarkNextFiltered
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
BenchmarkNextAll 20000 77698 ns/op
|
||||
--- BENCH: BenchmarkNextAll
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
BenchmarkNextAllFiltered 20000 85034 ns/op
|
||||
--- BENCH: BenchmarkNextAllFiltered
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
BenchmarkPrev 50000 56458 ns/op
|
||||
--- BENCH: BenchmarkPrev
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
BenchmarkPrevFiltered 50000 60163 ns/op
|
||||
--- BENCH: BenchmarkPrevFiltered
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
BenchmarkPrevAll 50000 47679 ns/op
|
||||
--- BENCH: BenchmarkPrevAll
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
BenchmarkPrevAllFiltered 50000 51563 ns/op
|
||||
--- BENCH: BenchmarkPrevAllFiltered
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
BenchmarkNextUntil 10000 213998 ns/op
|
||||
--- BENCH: BenchmarkNextUntil
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
BenchmarkNextUntilSelection 10000 140720 ns/op
|
||||
--- BENCH: BenchmarkNextUntilSelection
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
BenchmarkNextUntilNodes 20000 90702 ns/op
|
||||
--- BENCH: BenchmarkNextUntilNodes
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
BenchmarkPrevUntil 5000 456039 ns/op
|
||||
--- BENCH: BenchmarkPrevUntil
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
BenchmarkPrevUntilSelection 10000 167944 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilSelection
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
BenchmarkPrevUntilNodes 20000 82059 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilNodes
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
BenchmarkNextFilteredUntil 10000 150883 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntil
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
BenchmarkNextFilteredUntilSelection 10000 146578 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilSelection
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
BenchmarkNextFilteredUntilNodes 10000 148284 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilNodes
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
BenchmarkPrevFilteredUntil 10000 154303 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntil
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
BenchmarkPrevFilteredUntilSelection 10000 149062 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilSelection
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
BenchmarkPrevFilteredUntilNodes 10000 150584 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilNodes
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
ok github.com/PuerkitoBio/goquery 188.326s
|
||||
+438
@@ -0,0 +1,438 @@
|
||||
PASS
|
||||
BenchmarkFirst 20000000 96.2 ns/op
|
||||
BenchmarkLast 20000000 95.8 ns/op
|
||||
BenchmarkEq 20000000 94.4 ns/op
|
||||
BenchmarkSlice 20000000 89.9 ns/op
|
||||
BenchmarkGet 1000000000 2.31 ns/op
|
||||
BenchmarkIndex 1000000 1911 ns/op
|
||||
--- BENCH: BenchmarkIndex
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
BenchmarkIndexSelector 50000 56034 ns/op
|
||||
--- BENCH: BenchmarkIndexSelector
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
BenchmarkIndexOfNode 100000000 11.8 ns/op
|
||||
--- BENCH: BenchmarkIndexOfNode
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
BenchmarkIndexOfSelection 100000000 12.1 ns/op
|
||||
--- BENCH: BenchmarkIndexOfSelection
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
BenchmarkMetalReviewExample 5000 336823 ns/op
|
||||
--- BENCH: BenchmarkMetalReviewExample
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
|
||||
bench_example_test.go:41: MetalReviewExample=10
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
... [output truncated]
|
||||
BenchmarkAdd 50000 54709 ns/op
|
||||
--- BENCH: BenchmarkAdd
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
BenchmarkAddSelection 10000000 209 ns/op
|
||||
--- BENCH: BenchmarkAddSelection
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
BenchmarkAddNodes 10000000 202 ns/op
|
||||
--- BENCH: BenchmarkAddNodes
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
BenchmarkAndSelf 1000000 2634 ns/op
|
||||
--- BENCH: BenchmarkAndSelf
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
BenchmarkFilter 50000 31049 ns/op
|
||||
--- BENCH: BenchmarkFilter
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
BenchmarkNot 50000 35167 ns/op
|
||||
--- BENCH: BenchmarkNot
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
BenchmarkFilterFunction 50000 68974 ns/op
|
||||
--- BENCH: BenchmarkFilterFunction
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
BenchmarkNotFunction 50000 74760 ns/op
|
||||
--- BENCH: BenchmarkNotFunction
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
BenchmarkFilterNodes 50000 68670 ns/op
|
||||
--- BENCH: BenchmarkFilterNodes
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
BenchmarkNotNodes 20000 81357 ns/op
|
||||
--- BENCH: BenchmarkNotNodes
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
BenchmarkFilterSelection 50000 68388 ns/op
|
||||
--- BENCH: BenchmarkFilterSelection
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
BenchmarkNotSelection 20000 82108 ns/op
|
||||
--- BENCH: BenchmarkNotSelection
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
BenchmarkHas 5000 582934 ns/op
|
||||
--- BENCH: BenchmarkHas
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
BenchmarkHasNodes 10000 241602 ns/op
|
||||
--- BENCH: BenchmarkHasNodes
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
BenchmarkHasSelection 10000 243612 ns/op
|
||||
--- BENCH: BenchmarkHasSelection
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
BenchmarkEnd 500000000 4.14 ns/op
|
||||
--- BENCH: BenchmarkEnd
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
BenchmarkEach 200000 9848 ns/op
|
||||
--- BENCH: BenchmarkEach
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
BenchmarkMap 100000 17569 ns/op
|
||||
--- BENCH: BenchmarkMap
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
BenchmarkAttr 50000000 37.6 ns/op
|
||||
--- BENCH: BenchmarkAttr
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
BenchmarkText 100000 19345 ns/op
|
||||
BenchmarkLength 2000000000 0.80 ns/op
|
||||
--- BENCH: BenchmarkLength
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
BenchmarkHtml 5000000 688 ns/op
|
||||
BenchmarkIs 50000 35061 ns/op
|
||||
--- BENCH: BenchmarkIs
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
BenchmarkIsPositional 50000 32789 ns/op
|
||||
--- BENCH: BenchmarkIsPositional
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
BenchmarkIsFunction 1000000 2816 ns/op
|
||||
--- BENCH: BenchmarkIsFunction
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
BenchmarkIsSelection 50000 68272 ns/op
|
||||
--- BENCH: BenchmarkIsSelection
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
BenchmarkIsNodes 50000 68107 ns/op
|
||||
--- BENCH: BenchmarkIsNodes
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
BenchmarkHasClass 5000 709386 ns/op
|
||||
--- BENCH: BenchmarkHasClass
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
BenchmarkContains 100000000 12.4 ns/op
|
||||
--- BENCH: BenchmarkContains
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
BenchmarkFind 50000 56342 ns/op
|
||||
--- BENCH: BenchmarkFind
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
BenchmarkFindWithinSelection 10000 131878 ns/op
|
||||
--- BENCH: BenchmarkFindWithinSelection
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
BenchmarkFindSelection 5000 374240 ns/op
|
||||
--- BENCH: BenchmarkFindSelection
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
BenchmarkFindNodes 5000 374447 ns/op
|
||||
--- BENCH: BenchmarkFindNodes
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
BenchmarkContents 200000 9721 ns/op
|
||||
--- BENCH: BenchmarkContents
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
BenchmarkContentsFiltered 200000 12909 ns/op
|
||||
--- BENCH: BenchmarkContentsFiltered
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
BenchmarkChildren 1000000 1869 ns/op
|
||||
--- BENCH: BenchmarkChildren
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
BenchmarkChildrenFiltered 500000 5941 ns/op
|
||||
--- BENCH: BenchmarkChildrenFiltered
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
BenchmarkParent 50000 46223 ns/op
|
||||
--- BENCH: BenchmarkParent
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
BenchmarkParentFiltered 50000 51452 ns/op
|
||||
--- BENCH: BenchmarkParentFiltered
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
BenchmarkParents 20000 93967 ns/op
|
||||
--- BENCH: BenchmarkParents
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
BenchmarkParentsFiltered 20000 97617 ns/op
|
||||
--- BENCH: BenchmarkParentsFiltered
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
BenchmarkParentsUntil 10000 138898 ns/op
|
||||
--- BENCH: BenchmarkParentsUntil
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
BenchmarkParentsUntilSelection 10000 247817 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilSelection
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
BenchmarkParentsUntilNodes 10000 246055 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilNodes
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
BenchmarkParentsFilteredUntil 50000 33201 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntil
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
BenchmarkParentsFilteredUntilSelection 50000 31486 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilSelection
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
BenchmarkParentsFilteredUntilNodes 50000 31754 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilNodes
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
BenchmarkSiblings 20000 94749 ns/op
|
||||
--- BENCH: BenchmarkSiblings
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
BenchmarkSiblingsFiltered 10000 103926 ns/op
|
||||
--- BENCH: BenchmarkSiblingsFiltered
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
BenchmarkNext 50000 33782 ns/op
|
||||
--- BENCH: BenchmarkNext
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
BenchmarkNextFiltered 50000 37108 ns/op
|
||||
--- BENCH: BenchmarkNextFiltered
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
BenchmarkNextAll 50000 64769 ns/op
|
||||
--- BENCH: BenchmarkNextAll
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
BenchmarkNextAllFiltered 50000 71050 ns/op
|
||||
--- BENCH: BenchmarkNextAllFiltered
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
BenchmarkPrev 50000 33908 ns/op
|
||||
--- BENCH: BenchmarkPrev
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
BenchmarkPrevFiltered 50000 37353 ns/op
|
||||
--- BENCH: BenchmarkPrevFiltered
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
BenchmarkPrevAll 50000 31056 ns/op
|
||||
--- BENCH: BenchmarkPrevAll
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
BenchmarkPrevAllFiltered 50000 34286 ns/op
|
||||
--- BENCH: BenchmarkPrevAllFiltered
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
BenchmarkNextUntil 10000 202553 ns/op
|
||||
--- BENCH: BenchmarkNextUntil
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
BenchmarkNextUntilSelection 20000 98693 ns/op
|
||||
--- BENCH: BenchmarkNextUntilSelection
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
BenchmarkNextUntilNodes 50000 45532 ns/op
|
||||
--- BENCH: BenchmarkNextUntilNodes
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
BenchmarkPrevUntil 5000 454378 ns/op
|
||||
--- BENCH: BenchmarkPrevUntil
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
BenchmarkPrevUntilSelection 10000 123594 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilSelection
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
BenchmarkPrevUntilNodes 50000 37509 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilNodes
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
BenchmarkNextFilteredUntil 10000 109317 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntil
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
BenchmarkNextFilteredUntilSelection 10000 105959 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilSelection
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
BenchmarkNextFilteredUntilNodes 10000 107132 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilNodes
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
BenchmarkPrevFilteredUntil 10000 114474 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntil
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
BenchmarkPrevFilteredUntilSelection 10000 107592 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilSelection
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
BenchmarkPrevFilteredUntilNodes 10000 107495 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilNodes
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
ok github.com/PuerkitoBio/goquery 187.652s
|
||||
@@ -0,0 +1,405 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- Generated by SVGo -->
|
||||
<svg width="1024" height="768"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g style="font-size:20px;font-family:sans-serif">
|
||||
<rect x="0" y="0" width="1024" height="768" style="fill:white"/>
|
||||
<text x="100" y="50" style="font-size:150%"></text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="118" width="0" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="607" y="133" style="text-anchor:end">+0.10%</text>
|
||||
</g>
|
||||
<text x="100" y="138" style="text-anchor:start">BenchmarkFirst</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="144" width="0" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="617" y="159" style="text-anchor:start">-0.10%</text>
|
||||
</g>
|
||||
<text x="100" y="164" style="text-anchor:start">BenchmarkLast</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="604" y="170" width="8" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="599" y="185" style="text-anchor:end">+2.86%</text>
|
||||
</g>
|
||||
<text x="100" y="190" style="text-anchor:start">BenchmarkEq</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="604" y="196" width="8" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="599" y="211" style="text-anchor:end">+2.67%</text>
|
||||
</g>
|
||||
<text x="100" y="216" style="text-anchor:start">BenchmarkSlice</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="222" width="32" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="649" y="237" style="text-anchor:start">-10.82%</text>
|
||||
</g>
|
||||
<text x="100" y="242" style="text-anchor:start">BenchmarkGet</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="248" width="132" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="749" y="263" style="text-anchor:start">-44.06%</text>
|
||||
</g>
|
||||
<text x="100" y="268" style="text-anchor:start">BenchmarkIndex</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="274" width="156" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="773" y="289" style="text-anchor:start">-52.26%</text>
|
||||
</g>
|
||||
<text x="100" y="294" style="text-anchor:start">BenchmarkIndexSelector</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="300" width="27" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="644" y="315" style="text-anchor:start">-9.32%</text>
|
||||
</g>
|
||||
<text x="100" y="320" style="text-anchor:start">BenchmarkIndexOfNode</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="326" width="7" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="624" y="341" style="text-anchor:start">-2.48%</text>
|
||||
</g>
|
||||
<text x="100" y="346" style="text-anchor:start">BenchmarkIndexOfSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="352" width="104" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="721" y="367" style="text-anchor:start">-34.96%</text>
|
||||
</g>
|
||||
<text x="100" y="372" style="text-anchor:start">BenchmarkMetalReviewExample</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="378" width="177" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="794" y="393" style="text-anchor:start">-59.16%</text>
|
||||
</g>
|
||||
<text x="100" y="398" style="text-anchor:start">BenchmarkAdd</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="404" width="0" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="617" y="419" style="text-anchor:start">+0.00%</text>
|
||||
</g>
|
||||
<text x="100" y="424" style="text-anchor:start">BenchmarkAddSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="602" y="430" width="10" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="597" y="445" style="text-anchor:end">+3.47%</text>
|
||||
</g>
|
||||
<text x="100" y="450" style="text-anchor:start">BenchmarkAddNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="456" width="7" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="624" y="471" style="text-anchor:start">-2.51%</text>
|
||||
</g>
|
||||
<text x="100" y="476" style="text-anchor:start">BenchmarkAndSelf</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="482" width="41" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="658" y="497" style="text-anchor:start">-13.96%</text>
|
||||
</g>
|
||||
<text x="100" y="502" style="text-anchor:start">BenchmarkFilter</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="508" width="43" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="660" y="523" style="text-anchor:start">-14.53%</text>
|
||||
</g>
|
||||
<text x="100" y="528" style="text-anchor:start">BenchmarkNot</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="534" width="11" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="628" y="549" style="text-anchor:start">-3.81%</text>
|
||||
</g>
|
||||
<text x="100" y="554" style="text-anchor:start">BenchmarkFilterFunction</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="560" width="8" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="625" y="575" style="text-anchor:start">-2.83%</text>
|
||||
</g>
|
||||
<text x="100" y="580" style="text-anchor:start">BenchmarkNotFunction</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="586" width="13" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="630" y="601" style="text-anchor:start">-4.63%</text>
|
||||
</g>
|
||||
<text x="100" y="606" style="text-anchor:start">BenchmarkFilterNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="612" width="6" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="623" y="627" style="text-anchor:start">-2.32%</text>
|
||||
</g>
|
||||
<text x="100" y="632" style="text-anchor:start">BenchmarkNotNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="638" width="12" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="629" y="653" style="text-anchor:start">-4.23%</text>
|
||||
</g>
|
||||
<text x="100" y="658" style="text-anchor:start">BenchmarkFilterSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="664" width="9" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="626" y="679" style="text-anchor:start">-3.31%</text>
|
||||
</g>
|
||||
<text x="100" y="684" style="text-anchor:start">BenchmarkNotSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="690" width="101" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="718" y="705" style="text-anchor:start">-33.69%</text>
|
||||
</g>
|
||||
<text x="100" y="710" style="text-anchor:start">BenchmarkHas</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="716" width="13" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="630" y="731" style="text-anchor:start">-4.53%</text>
|
||||
</g>
|
||||
<text x="100" y="736" style="text-anchor:start">BenchmarkHasNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="742" width="15" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="632" y="757" style="text-anchor:start">-5.30%</text>
|
||||
</g>
|
||||
<text x="100" y="762" style="text-anchor:start">BenchmarkHasSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="578" y="768" width="34" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="573" y="783" style="text-anchor:end">+11.35%</text>
|
||||
</g>
|
||||
<text x="100" y="788" style="text-anchor:start">BenchmarkEnd</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="794" width="9" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="626" y="809" style="text-anchor:start">-3.33%</text>
|
||||
</g>
|
||||
<text x="100" y="814" style="text-anchor:start">BenchmarkEach</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="820" width="27" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="644" y="835" style="text-anchor:start">-9.16%</text>
|
||||
</g>
|
||||
<text x="100" y="840" style="text-anchor:start">BenchmarkMap</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="846" width="57" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="674" y="861" style="text-anchor:start">-19.15%</text>
|
||||
</g>
|
||||
<text x="100" y="866" style="text-anchor:start">BenchmarkAttr</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="872" width="9" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="626" y="887" style="text-anchor:start">-3.24%</text>
|
||||
</g>
|
||||
<text x="100" y="892" style="text-anchor:start">BenchmarkText</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="898" width="183" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="800" y="913" style="text-anchor:start">-61.25%</text>
|
||||
</g>
|
||||
<text x="100" y="918" style="text-anchor:start">BenchmarkLength</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="924" width="35" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="652" y="939" style="text-anchor:start">-11.92%</text>
|
||||
</g>
|
||||
<text x="100" y="944" style="text-anchor:start">BenchmarkHtml</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="950" width="49" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="666" y="965" style="text-anchor:start">-16.46%</text>
|
||||
</g>
|
||||
<text x="100" y="970" style="text-anchor:start">BenchmarkIs</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="976" width="81" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="698" y="991" style="text-anchor:start">-27.31%</text>
|
||||
</g>
|
||||
<text x="100" y="996" style="text-anchor:start">BenchmarkIsPositional</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1002" width="40" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="657" y="1017" style="text-anchor:start">-13.49%</text>
|
||||
</g>
|
||||
<text x="100" y="1022" style="text-anchor:start">BenchmarkIsFunction</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1028" width="5" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="622" y="1043" style="text-anchor:start">-1.71%</text>
|
||||
</g>
|
||||
<text x="100" y="1048" style="text-anchor:start">BenchmarkIsSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1054" width="9" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="626" y="1069" style="text-anchor:start">-3.03%</text>
|
||||
</g>
|
||||
<text x="100" y="1074" style="text-anchor:start">BenchmarkIsNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1080" width="60" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="677" y="1095" style="text-anchor:start">-20.30%</text>
|
||||
</g>
|
||||
<text x="100" y="1100" style="text-anchor:start">BenchmarkHasClass</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1106" width="33" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="650" y="1121" style="text-anchor:start">-11.29%</text>
|
||||
</g>
|
||||
<text x="100" y="1126" style="text-anchor:start">BenchmarkContains</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1132" width="152" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="769" y="1147" style="text-anchor:start">-50.88%</text>
|
||||
</g>
|
||||
<text x="100" y="1152" style="text-anchor:start">BenchmarkFind</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1158" width="135" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="752" y="1173" style="text-anchor:start">-45.28%</text>
|
||||
</g>
|
||||
<text x="100" y="1178" style="text-anchor:start">BenchmarkFindWithinSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="544" y="1184" width="68" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="539" y="1199" style="text-anchor:end">+22.95%</text>
|
||||
</g>
|
||||
<text x="100" y="1204" style="text-anchor:start">BenchmarkFindSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="544" y="1210" width="68" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="539" y="1225" style="text-anchor:end">+22.68%</text>
|
||||
</g>
|
||||
<text x="100" y="1230" style="text-anchor:start">BenchmarkFindNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1236" width="195" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="812" y="1251" style="text-anchor:start">-65.08%</text>
|
||||
</g>
|
||||
<text x="100" y="1256" style="text-anchor:start">BenchmarkContents</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1262" width="179" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="796" y="1277" style="text-anchor:start">-59.77%</text>
|
||||
</g>
|
||||
<text x="100" y="1282" style="text-anchor:start">BenchmarkContentsFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1288" width="192" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="809" y="1303" style="text-anchor:start">-64.31%</text>
|
||||
</g>
|
||||
<text x="100" y="1308" style="text-anchor:start">BenchmarkChildren</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1314" width="118" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="735" y="1329" style="text-anchor:start">-39.56%</text>
|
||||
</g>
|
||||
<text x="100" y="1334" style="text-anchor:start">BenchmarkChildrenFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1340" width="19" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="636" y="1355" style="text-anchor:start">-6.61%</text>
|
||||
</g>
|
||||
<text x="100" y="1360" style="text-anchor:start">BenchmarkParent</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1366" width="32" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="649" y="1381" style="text-anchor:start">-10.92%</text>
|
||||
</g>
|
||||
<text x="100" y="1386" style="text-anchor:start">BenchmarkParentFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1392" width="5" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="622" y="1407" style="text-anchor:start">-1.72%</text>
|
||||
</g>
|
||||
<text x="100" y="1412" style="text-anchor:start">BenchmarkParents</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1418" width="7" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="624" y="1433" style="text-anchor:start">-2.37%</text>
|
||||
</g>
|
||||
<text x="100" y="1438" style="text-anchor:start">BenchmarkParentsFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1444" width="142" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="759" y="1459" style="text-anchor:start">-47.60%</text>
|
||||
</g>
|
||||
<text x="100" y="1464" style="text-anchor:start">BenchmarkParentsUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1470" width="109" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="726" y="1485" style="text-anchor:start">-36.39%</text>
|
||||
</g>
|
||||
<text x="100" y="1490" style="text-anchor:start">BenchmarkParentsUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1496" width="107" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="724" y="1511" style="text-anchor:start">-35.99%</text>
|
||||
</g>
|
||||
<text x="100" y="1516" style="text-anchor:start">BenchmarkParentsUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1522" width="146" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="763" y="1537" style="text-anchor:start">-48.84%</text>
|
||||
</g>
|
||||
<text x="100" y="1542" style="text-anchor:start">BenchmarkParentsFilteredUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1548" width="98" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="715" y="1563" style="text-anchor:start">-32.75%</text>
|
||||
</g>
|
||||
<text x="100" y="1568" style="text-anchor:start">BenchmarkParentsFilteredUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1574" width="99" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="716" y="1589" style="text-anchor:start">-33.12%</text>
|
||||
</g>
|
||||
<text x="100" y="1594" style="text-anchor:start">BenchmarkParentsFilteredUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1600" width="89" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="706" y="1615" style="text-anchor:start">-29.78%</text>
|
||||
</g>
|
||||
<text x="100" y="1620" style="text-anchor:start">BenchmarkSiblings</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1626" width="92" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="709" y="1641" style="text-anchor:start">-30.89%</text>
|
||||
</g>
|
||||
<text x="100" y="1646" style="text-anchor:start">BenchmarkSiblingsFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1652" width="204" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="821" y="1667" style="text-anchor:start">-68.19%</text>
|
||||
</g>
|
||||
<text x="100" y="1672" style="text-anchor:start">BenchmarkNext</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1678" width="199" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="816" y="1693" style="text-anchor:start">-66.59%</text>
|
||||
</g>
|
||||
<text x="100" y="1698" style="text-anchor:start">BenchmarkNextFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1704" width="93" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="710" y="1719" style="text-anchor:start">-31.08%</text>
|
||||
</g>
|
||||
<text x="100" y="1724" style="text-anchor:start">BenchmarkNextAll</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1730" width="90" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="707" y="1745" style="text-anchor:start">-30.03%</text>
|
||||
</g>
|
||||
<text x="100" y="1750" style="text-anchor:start">BenchmarkNextAllFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1756" width="204" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="821" y="1771" style="text-anchor:start">-68.32%</text>
|
||||
</g>
|
||||
<text x="100" y="1776" style="text-anchor:start">BenchmarkPrev</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1782" width="199" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="816" y="1797" style="text-anchor:start">-66.65%</text>
|
||||
</g>
|
||||
<text x="100" y="1802" style="text-anchor:start">BenchmarkPrevFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1808" width="129" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="746" y="1823" style="text-anchor:start">-43.33%</text>
|
||||
</g>
|
||||
<text x="100" y="1828" style="text-anchor:start">BenchmarkPrevAll</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1834" width="129" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="746" y="1849" style="text-anchor:start">-43.24%</text>
|
||||
</g>
|
||||
<text x="100" y="1854" style="text-anchor:start">BenchmarkPrevAllFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1860" width="162" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="779" y="1875" style="text-anchor:start">-54.27%</text>
|
||||
</g>
|
||||
<text x="100" y="1880" style="text-anchor:start">BenchmarkNextUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1886" width="113" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="730" y="1901" style="text-anchor:start">-37.90%</text>
|
||||
</g>
|
||||
<text x="100" y="1906" style="text-anchor:start">BenchmarkNextUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1912" width="129" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="746" y="1927" style="text-anchor:start">-43.21%</text>
|
||||
</g>
|
||||
<text x="100" y="1932" style="text-anchor:start">BenchmarkNextUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1938" width="147" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="764" y="1953" style="text-anchor:start">-49.33%</text>
|
||||
</g>
|
||||
<text x="100" y="1958" style="text-anchor:start">BenchmarkPrevUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1964" width="111" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="728" y="1979" style="text-anchor:start">-37.02%</text>
|
||||
</g>
|
||||
<text x="100" y="1984" style="text-anchor:start">BenchmarkPrevUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1990" width="133" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="750" y="2005" style="text-anchor:start">-44.59%</text>
|
||||
</g>
|
||||
<text x="100" y="2010" style="text-anchor:start">BenchmarkPrevUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2016" width="173" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="790" y="2031" style="text-anchor:start">-57.79%</text>
|
||||
</g>
|
||||
<text x="100" y="2036" style="text-anchor:start">BenchmarkNextFilteredUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2042" width="109" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="726" y="2057" style="text-anchor:start">-36.61%</text>
|
||||
</g>
|
||||
<text x="100" y="2062" style="text-anchor:start">BenchmarkNextFilteredUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2068" width="113" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="730" y="2083" style="text-anchor:start">-37.81%</text>
|
||||
</g>
|
||||
<text x="100" y="2088" style="text-anchor:start">BenchmarkNextFilteredUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2094" width="177" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="794" y="2109" style="text-anchor:start">-59.21%</text>
|
||||
</g>
|
||||
<text x="100" y="2114" style="text-anchor:start">BenchmarkPrevFilteredUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2120" width="108" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="725" y="2135" style="text-anchor:start">-36.20%</text>
|
||||
</g>
|
||||
<text x="100" y="2140" style="text-anchor:start">BenchmarkPrevFilteredUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2146" width="108" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="725" y="2161" style="text-anchor:start">-36.05%</text>
|
||||
</g>
|
||||
<text x="100" y="2166" style="text-anchor:start">BenchmarkPrevFilteredUntilNodes</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 21 KiB |
+459
@@ -0,0 +1,459 @@
|
||||
PASS
|
||||
BenchmarkFirst 20000000 94.3 ns/op
|
||||
BenchmarkLast 20000000 94.7 ns/op
|
||||
BenchmarkEq 20000000 93.7 ns/op
|
||||
BenchmarkSlice 20000000 89.9 ns/op
|
||||
BenchmarkGet 1000000000 2.72 ns/op
|
||||
BenchmarkIndex 1000000 1834 ns/op
|
||||
--- BENCH: BenchmarkIndex
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
BenchmarkIndexSelector 50000 53958 ns/op
|
||||
--- BENCH: BenchmarkIndexSelector
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
BenchmarkIndexOfNode 100000000 10.1 ns/op
|
||||
--- BENCH: BenchmarkIndexOfNode
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
BenchmarkIndexOfSelection 100000000 10.9 ns/op
|
||||
--- BENCH: BenchmarkIndexOfSelection
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
BenchmarkMetalReviewExample 5000 326712 ns/op
|
||||
--- BENCH: BenchmarkMetalReviewExample
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
|
||||
bench_example_test.go:41: MetalReviewExample=10
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
... [output truncated]
|
||||
BenchmarkAdd 50000 51776 ns/op
|
||||
--- BENCH: BenchmarkAdd
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
BenchmarkAddSelection 10000000 196 ns/op
|
||||
--- BENCH: BenchmarkAddSelection
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
BenchmarkAddNodes 10000000 191 ns/op
|
||||
--- BENCH: BenchmarkAddNodes
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
BenchmarkAndSelf 1000000 2495 ns/op
|
||||
--- BENCH: BenchmarkAndSelf
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
BenchmarkFilter 50000 30974 ns/op
|
||||
--- BENCH: BenchmarkFilter
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
BenchmarkNot 50000 35322 ns/op
|
||||
--- BENCH: BenchmarkNot
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
BenchmarkFilterFunction 50000 65644 ns/op
|
||||
--- BENCH: BenchmarkFilterFunction
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
BenchmarkNotFunction 50000 69245 ns/op
|
||||
--- BENCH: BenchmarkNotFunction
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
BenchmarkFilterNodes 50000 64824 ns/op
|
||||
--- BENCH: BenchmarkFilterNodes
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
BenchmarkNotNodes 20000 76247 ns/op
|
||||
--- BENCH: BenchmarkNotNodes
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
BenchmarkFilterSelection 50000 66154 ns/op
|
||||
--- BENCH: BenchmarkFilterSelection
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
BenchmarkNotSelection 20000 76336 ns/op
|
||||
--- BENCH: BenchmarkNotSelection
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
BenchmarkHas 5000 569495 ns/op
|
||||
--- BENCH: BenchmarkHas
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
BenchmarkHasNodes 10000 227059 ns/op
|
||||
--- BENCH: BenchmarkHasNodes
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
BenchmarkHasSelection 10000 227167 ns/op
|
||||
--- BENCH: BenchmarkHasSelection
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
BenchmarkEnd 500000000 3.99 ns/op
|
||||
--- BENCH: BenchmarkEnd
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
BenchmarkEach 200000 9354 ns/op
|
||||
--- BENCH: BenchmarkEach
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
BenchmarkMap 100000 16557 ns/op
|
||||
--- BENCH: BenchmarkMap
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
BenchmarkAttr 50000000 36.4 ns/op
|
||||
--- BENCH: BenchmarkAttr
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
BenchmarkText 100000 18473 ns/op
|
||||
BenchmarkLength 2000000000 0.76 ns/op
|
||||
--- BENCH: BenchmarkLength
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
BenchmarkHtml 5000000 666 ns/op
|
||||
BenchmarkIs 50000 35174 ns/op
|
||||
--- BENCH: BenchmarkIs
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
BenchmarkIsPositional 50000 31814 ns/op
|
||||
--- BENCH: BenchmarkIsPositional
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
BenchmarkIsFunction 1000000 2754 ns/op
|
||||
--- BENCH: BenchmarkIsFunction
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
BenchmarkIsSelection 50000 66260 ns/op
|
||||
--- BENCH: BenchmarkIsSelection
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
BenchmarkIsNodes 50000 64682 ns/op
|
||||
--- BENCH: BenchmarkIsNodes
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
BenchmarkHasClass 5000 672953 ns/op
|
||||
--- BENCH: BenchmarkHasClass
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
BenchmarkContains 100000000 11.3 ns/op
|
||||
--- BENCH: BenchmarkContains
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
BenchmarkFind 50000 53780 ns/op
|
||||
--- BENCH: BenchmarkFind
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
BenchmarkFindWithinSelection 10000 125963 ns/op
|
||||
--- BENCH: BenchmarkFindWithinSelection
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
BenchmarkFindSelection 5000 357318 ns/op
|
||||
--- BENCH: BenchmarkFindSelection
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
BenchmarkFindNodes 5000 357587 ns/op
|
||||
--- BENCH: BenchmarkFindNodes
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
BenchmarkContents 200000 9135 ns/op
|
||||
--- BENCH: BenchmarkContents
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
BenchmarkContentsFiltered 200000 12383 ns/op
|
||||
--- BENCH: BenchmarkContentsFiltered
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
BenchmarkChildren 1000000 1809 ns/op
|
||||
--- BENCH: BenchmarkChildren
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
BenchmarkChildrenFiltered 500000 5814 ns/op
|
||||
--- BENCH: BenchmarkChildrenFiltered
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
BenchmarkParent 50000 44810 ns/op
|
||||
--- BENCH: BenchmarkParent
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
BenchmarkParentFiltered 50000 48795 ns/op
|
||||
--- BENCH: BenchmarkParentFiltered
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
BenchmarkParents 20000 89102 ns/op
|
||||
--- BENCH: BenchmarkParents
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
BenchmarkParentsFiltered 20000 93953 ns/op
|
||||
--- BENCH: BenchmarkParentsFiltered
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
BenchmarkParentsUntil 10000 130783 ns/op
|
||||
--- BENCH: BenchmarkParentsUntil
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
BenchmarkParentsUntilSelection 10000 231797 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilSelection
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
BenchmarkParentsUntilNodes 10000 233761 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilNodes
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
BenchmarkParentsFilteredUntil 50000 31360 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntil
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
BenchmarkParentsFilteredUntilSelection 50000 30272 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilSelection
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
BenchmarkParentsFilteredUntilNodes 50000 30327 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilNodes
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
BenchmarkSiblings 20000 89862 ns/op
|
||||
--- BENCH: BenchmarkSiblings
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
BenchmarkSiblingsFiltered 20000 97948 ns/op
|
||||
--- BENCH: BenchmarkSiblingsFiltered
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
BenchmarkNext 50000 31975 ns/op
|
||||
--- BENCH: BenchmarkNext
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
BenchmarkNextFiltered 50000 34887 ns/op
|
||||
--- BENCH: BenchmarkNextFiltered
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
BenchmarkNextAll 50000 60734 ns/op
|
||||
--- BENCH: BenchmarkNextAll
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
BenchmarkNextAllFiltered 50000 67428 ns/op
|
||||
--- BENCH: BenchmarkNextAllFiltered
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
BenchmarkPrev 50000 32399 ns/op
|
||||
--- BENCH: BenchmarkPrev
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
BenchmarkPrevFiltered 50000 34944 ns/op
|
||||
--- BENCH: BenchmarkPrevFiltered
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
BenchmarkPrevAll 100000 29360 ns/op
|
||||
--- BENCH: BenchmarkPrevAll
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
BenchmarkPrevAllFiltered 50000 32291 ns/op
|
||||
--- BENCH: BenchmarkPrevAllFiltered
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
BenchmarkNextUntil 10000 191890 ns/op
|
||||
--- BENCH: BenchmarkNextUntil
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
BenchmarkNextUntilSelection 20000 92054 ns/op
|
||||
--- BENCH: BenchmarkNextUntilSelection
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
BenchmarkNextUntilNodes 50000 43401 ns/op
|
||||
--- BENCH: BenchmarkNextUntilNodes
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
BenchmarkPrevUntil 5000 433383 ns/op
|
||||
--- BENCH: BenchmarkPrevUntil
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
BenchmarkPrevUntilSelection 10000 116423 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilSelection
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
BenchmarkPrevUntilNodes 50000 35338 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilNodes
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
BenchmarkNextFilteredUntil 10000 104686 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntil
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
BenchmarkNextFilteredUntilSelection 20000 99485 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilSelection
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
BenchmarkNextFilteredUntilNodes 20000 99452 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilNodes
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
BenchmarkPrevFilteredUntil 10000 112640 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntil
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
BenchmarkPrevFilteredUntilSelection 10000 103702 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilSelection
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
BenchmarkPrevFilteredUntilNodes 10000 103277 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilNodes
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
BenchmarkClosest 500000 6530 ns/op
|
||||
--- BENCH: BenchmarkClosest
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
BenchmarkClosestSelection 1000000 1135 ns/op
|
||||
--- BENCH: BenchmarkClosestSelection
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
BenchmarkClosestNodes 1000000 1133 ns/op
|
||||
--- BENCH: BenchmarkClosestNodes
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
ok github.com/PuerkitoBio/goquery 192.541s
|
||||
@@ -0,0 +1,420 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- Generated by SVGo -->
|
||||
<svg width="1024" height="768"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g style="font-size:20px;font-family:sans-serif">
|
||||
<rect x="0" y="0" width="1024" height="768" style="fill:white"/>
|
||||
<text x="100" y="50" style="font-size:150%"></text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="606" y="118" width="6" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="601" y="133" style="text-anchor:end">+2.12%</text>
|
||||
</g>
|
||||
<text x="100" y="138" style="text-anchor:start">BenchmarkFirst</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="609" y="144" width="3" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="604" y="159" style="text-anchor:end">+1.06%</text>
|
||||
</g>
|
||||
<text x="100" y="164" style="text-anchor:start">BenchmarkLast</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="602" y="170" width="10" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="597" y="185" style="text-anchor:end">+3.63%</text>
|
||||
</g>
|
||||
<text x="100" y="190" style="text-anchor:start">BenchmarkEq</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="604" y="196" width="8" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="599" y="211" style="text-anchor:end">+2.67%</text>
|
||||
</g>
|
||||
<text x="100" y="216" style="text-anchor:start">BenchmarkSlice</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="222" width="72" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="689" y="237" style="text-anchor:start">-24.26%</text>
|
||||
</g>
|
||||
<text x="100" y="242" style="text-anchor:start">BenchmarkGet</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="248" width="125" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="742" y="263" style="text-anchor:start">-41.71%</text>
|
||||
</g>
|
||||
<text x="100" y="268" style="text-anchor:start">BenchmarkIndex</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="274" width="151" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="768" y="289" style="text-anchor:start">-50.42%</text>
|
||||
</g>
|
||||
<text x="100" y="294" style="text-anchor:start">BenchmarkIndexSelector</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="595" y="300" width="17" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="590" y="315" style="text-anchor:end">+5.94%</text>
|
||||
</g>
|
||||
<text x="100" y="320" style="text-anchor:start">BenchmarkIndexOfNode</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="588" y="326" width="24" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="583" y="341" style="text-anchor:end">+8.26%</text>
|
||||
</g>
|
||||
<text x="100" y="346" style="text-anchor:start">BenchmarkIndexOfSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="352" width="98" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="715" y="367" style="text-anchor:start">-32.94%</text>
|
||||
</g>
|
||||
<text x="100" y="372" style="text-anchor:start">BenchmarkMetalReviewExample</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="378" width="170" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="787" y="393" style="text-anchor:start">-56.84%</text>
|
||||
</g>
|
||||
<text x="100" y="398" style="text-anchor:start">BenchmarkAdd</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="593" y="404" width="19" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="588" y="419" style="text-anchor:end">+6.63%</text>
|
||||
</g>
|
||||
<text x="100" y="424" style="text-anchor:start">BenchmarkAddSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="584" y="430" width="28" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="579" y="445" style="text-anchor:end">+9.42%</text>
|
||||
</g>
|
||||
<text x="100" y="450" style="text-anchor:start">BenchmarkAddNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="604" y="456" width="8" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="599" y="471" style="text-anchor:end">+2.93%</text>
|
||||
</g>
|
||||
<text x="100" y="476" style="text-anchor:start">BenchmarkAndSelf</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="482" width="41" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="658" y="497" style="text-anchor:start">-13.75%</text>
|
||||
</g>
|
||||
<text x="100" y="502" style="text-anchor:start">BenchmarkFilter</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="508" width="44" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="661" y="523" style="text-anchor:start">-14.90%</text>
|
||||
</g>
|
||||
<text x="100" y="528" style="text-anchor:start">BenchmarkNot</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="609" y="534" width="3" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="604" y="549" style="text-anchor:end">+1.07%</text>
|
||||
</g>
|
||||
<text x="100" y="554" style="text-anchor:start">BenchmarkFilterFunction</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="598" y="560" width="14" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="593" y="575" style="text-anchor:end">+4.91%</text>
|
||||
</g>
|
||||
<text x="100" y="580" style="text-anchor:start">BenchmarkNotFunction</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="609" y="586" width="3" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="604" y="601" style="text-anchor:end">+1.03%</text>
|
||||
</g>
|
||||
<text x="100" y="606" style="text-anchor:start">BenchmarkFilterNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="600" y="612" width="12" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="595" y="627" style="text-anchor:end">+4.22%</text>
|
||||
</g>
|
||||
<text x="100" y="632" style="text-anchor:start">BenchmarkNotNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="638" width="3" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="620" y="653" style="text-anchor:start">-1.00%</text>
|
||||
</g>
|
||||
<text x="100" y="658" style="text-anchor:start">BenchmarkFilterSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="600" y="664" width="12" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="595" y="679" style="text-anchor:end">+4.00%</text>
|
||||
</g>
|
||||
<text x="100" y="684" style="text-anchor:start">BenchmarkNotSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="690" width="96" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="713" y="705" style="text-anchor:start">-32.12%</text>
|
||||
</g>
|
||||
<text x="100" y="710" style="text-anchor:start">BenchmarkHas</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="608" y="716" width="4" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="603" y="731" style="text-anchor:end">+1.59%</text>
|
||||
</g>
|
||||
<text x="100" y="736" style="text-anchor:start">BenchmarkHasNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="608" y="742" width="4" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="603" y="757" style="text-anchor:end">+1.56%</text>
|
||||
</g>
|
||||
<text x="100" y="762" style="text-anchor:start">BenchmarkHasSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="566" y="768" width="46" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="561" y="783" style="text-anchor:end">+15.54%</text>
|
||||
</g>
|
||||
<text x="100" y="788" style="text-anchor:start">BenchmarkEnd</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="607" y="794" width="5" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="602" y="809" style="text-anchor:end">+1.77%</text>
|
||||
</g>
|
||||
<text x="100" y="814" style="text-anchor:start">BenchmarkEach</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="820" width="10" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="627" y="835" style="text-anchor:start">-3.61%</text>
|
||||
</g>
|
||||
<text x="100" y="840" style="text-anchor:start">BenchmarkMap</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="846" width="49" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="666" y="861" style="text-anchor:start">-16.48%</text>
|
||||
</g>
|
||||
<text x="100" y="866" style="text-anchor:start">BenchmarkAttr</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="609" y="872" width="3" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="604" y="887" style="text-anchor:end">+1.33%</text>
|
||||
</g>
|
||||
<text x="100" y="892" style="text-anchor:start">BenchmarkText</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="898" width="177" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="794" y="913" style="text-anchor:start">-59.21%</text>
|
||||
</g>
|
||||
<text x="100" y="918" style="text-anchor:start">BenchmarkLength</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="924" width="27" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="644" y="939" style="text-anchor:start">-9.01%</text>
|
||||
</g>
|
||||
<text x="100" y="944" style="text-anchor:start">BenchmarkHtml</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="950" width="50" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="667" y="965" style="text-anchor:start">-16.73%</text>
|
||||
</g>
|
||||
<text x="100" y="970" style="text-anchor:start">BenchmarkIs</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="976" width="75" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="692" y="991" style="text-anchor:start">-25.08%</text>
|
||||
</g>
|
||||
<text x="100" y="996" style="text-anchor:start">BenchmarkIsPositional</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1002" width="34" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="651" y="1017" style="text-anchor:start">-11.55%</text>
|
||||
</g>
|
||||
<text x="100" y="1022" style="text-anchor:start">BenchmarkIsFunction</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="609" y="1028" width="3" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="604" y="1043" style="text-anchor:end">+1.28%</text>
|
||||
</g>
|
||||
<text x="100" y="1048" style="text-anchor:start">BenchmarkIsSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="606" y="1054" width="6" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="601" y="1069" style="text-anchor:end">+2.10%</text>
|
||||
</g>
|
||||
<text x="100" y="1074" style="text-anchor:start">BenchmarkIsNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1080" width="47" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="664" y="1095" style="text-anchor:start">-15.99%</text>
|
||||
</g>
|
||||
<text x="100" y="1100" style="text-anchor:start">BenchmarkHasClass</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1106" width="7" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="624" y="1121" style="text-anchor:start">-2.65%</text>
|
||||
</g>
|
||||
<text x="100" y="1126" style="text-anchor:start">BenchmarkContains</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1132" width="145" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="762" y="1147" style="text-anchor:start">-48.54%</text>
|
||||
</g>
|
||||
<text x="100" y="1152" style="text-anchor:start">BenchmarkFind</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1158" width="128" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="745" y="1173" style="text-anchor:start">-42.71%</text>
|
||||
</g>
|
||||
<text x="100" y="1178" style="text-anchor:start">BenchmarkFindWithinSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="526" y="1184" width="86" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="521" y="1199" style="text-anchor:end">+28.77%</text>
|
||||
</g>
|
||||
<text x="100" y="1204" style="text-anchor:start">BenchmarkFindSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="527" y="1210" width="85" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="522" y="1225" style="text-anchor:end">+28.47%</text>
|
||||
</g>
|
||||
<text x="100" y="1230" style="text-anchor:start">BenchmarkFindNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1236" width="188" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="805" y="1251" style="text-anchor:start">-62.84%</text>
|
||||
</g>
|
||||
<text x="100" y="1256" style="text-anchor:start">BenchmarkContents</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1262" width="174" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="791" y="1277" style="text-anchor:start">-58.06%</text>
|
||||
</g>
|
||||
<text x="100" y="1282" style="text-anchor:start">BenchmarkContentsFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1288" width="189" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="806" y="1303" style="text-anchor:start">-63.13%</text>
|
||||
</g>
|
||||
<text x="100" y="1308" style="text-anchor:start">BenchmarkChildren</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1314" width="114" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="731" y="1329" style="text-anchor:start">-38.24%</text>
|
||||
</g>
|
||||
<text x="100" y="1334" style="text-anchor:start">BenchmarkChildrenFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1340" width="10" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="627" y="1355" style="text-anchor:start">-3.66%</text>
|
||||
</g>
|
||||
<text x="100" y="1360" style="text-anchor:start">BenchmarkParent</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1366" width="18" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="635" y="1381" style="text-anchor:start">-6.06%</text>
|
||||
</g>
|
||||
<text x="100" y="1386" style="text-anchor:start">BenchmarkParentFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="602" y="1392" width="10" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="597" y="1407" style="text-anchor:end">+3.64%</text>
|
||||
</g>
|
||||
<text x="100" y="1412" style="text-anchor:start">BenchmarkParents</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="608" y="1418" width="4" height="20" style="fill-opacity:0.3;fill:red"/>
|
||||
<text x="603" y="1433" style="text-anchor:end">+1.44%</text>
|
||||
</g>
|
||||
<text x="100" y="1438" style="text-anchor:start">BenchmarkParentsFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1444" width="133" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="750" y="1459" style="text-anchor:start">-44.35%</text>
|
||||
</g>
|
||||
<text x="100" y="1464" style="text-anchor:start">BenchmarkParentsUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1470" width="95" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="712" y="1485" style="text-anchor:start">-31.99%</text>
|
||||
</g>
|
||||
<text x="100" y="1490" style="text-anchor:start">BenchmarkParentsUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1496" width="97" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="714" y="1511" style="text-anchor:start">-32.62%</text>
|
||||
</g>
|
||||
<text x="100" y="1516" style="text-anchor:start">BenchmarkParentsUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1522" width="137" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="754" y="1537" style="text-anchor:start">-45.83%</text>
|
||||
</g>
|
||||
<text x="100" y="1542" style="text-anchor:start">BenchmarkParentsFilteredUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1548" width="90" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="707" y="1563" style="text-anchor:start">-30.05%</text>
|
||||
</g>
|
||||
<text x="100" y="1568" style="text-anchor:start">BenchmarkParentsFilteredUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1574" width="89" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="706" y="1589" style="text-anchor:start">-29.97%</text>
|
||||
</g>
|
||||
<text x="100" y="1594" style="text-anchor:start">BenchmarkParentsFilteredUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1600" width="77" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="694" y="1615" style="text-anchor:start">-25.96%</text>
|
||||
</g>
|
||||
<text x="100" y="1620" style="text-anchor:start">BenchmarkSiblings</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1626" width="80" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="697" y="1641" style="text-anchor:start">-26.67%</text>
|
||||
</g>
|
||||
<text x="100" y="1646" style="text-anchor:start">BenchmarkSiblingsFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1652" width="199" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="816" y="1667" style="text-anchor:start">-66.40%</text>
|
||||
</g>
|
||||
<text x="100" y="1672" style="text-anchor:start">BenchmarkNext</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1678" width="193" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="810" y="1693" style="text-anchor:start">-64.46%</text>
|
||||
</g>
|
||||
<text x="100" y="1698" style="text-anchor:start">BenchmarkNextFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1704" width="79" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="696" y="1719" style="text-anchor:start">-26.50%</text>
|
||||
</g>
|
||||
<text x="100" y="1724" style="text-anchor:start">BenchmarkNextAll</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1730" width="78" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="695" y="1745" style="text-anchor:start">-26.27%</text>
|
||||
</g>
|
||||
<text x="100" y="1750" style="text-anchor:start">BenchmarkNextAllFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1756" width="200" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="817" y="1771" style="text-anchor:start">-66.84%</text>
|
||||
</g>
|
||||
<text x="100" y="1776" style="text-anchor:start">BenchmarkPrev</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1782" width="193" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="810" y="1797" style="text-anchor:start">-64.35%</text>
|
||||
</g>
|
||||
<text x="100" y="1802" style="text-anchor:start">BenchmarkPrevFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1808" width="120" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="737" y="1823" style="text-anchor:start">-40.05%</text>
|
||||
</g>
|
||||
<text x="100" y="1828" style="text-anchor:start">BenchmarkPrevAll</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1834" width="119" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="736" y="1849" style="text-anchor:start">-39.74%</text>
|
||||
</g>
|
||||
<text x="100" y="1854" style="text-anchor:start">BenchmarkPrevAllFiltered</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1860" width="155" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="772" y="1875" style="text-anchor:start">-51.73%</text>
|
||||
</g>
|
||||
<text x="100" y="1880" style="text-anchor:start">BenchmarkNextUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1886" width="100" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="717" y="1901" style="text-anchor:start">-33.42%</text>
|
||||
</g>
|
||||
<text x="100" y="1906" style="text-anchor:start">BenchmarkNextUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1912" width="121" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="738" y="1927" style="text-anchor:start">-40.42%</text>
|
||||
</g>
|
||||
<text x="100" y="1932" style="text-anchor:start">BenchmarkNextUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1938" width="140" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="757" y="1953" style="text-anchor:start">-46.87%</text>
|
||||
</g>
|
||||
<text x="100" y="1958" style="text-anchor:start">BenchmarkPrevUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1964" width="99" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="716" y="1979" style="text-anchor:start">-33.14%</text>
|
||||
</g>
|
||||
<text x="100" y="1984" style="text-anchor:start">BenchmarkPrevUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="1990" width="123" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="740" y="2005" style="text-anchor:start">-41.19%</text>
|
||||
</g>
|
||||
<text x="100" y="2010" style="text-anchor:start">BenchmarkPrevUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2016" width="167" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="784" y="2031" style="text-anchor:start">-55.92%</text>
|
||||
</g>
|
||||
<text x="100" y="2036" style="text-anchor:start">BenchmarkNextFilteredUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2042" width="97" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="714" y="2057" style="text-anchor:start">-32.49%</text>
|
||||
</g>
|
||||
<text x="100" y="2062" style="text-anchor:start">BenchmarkNextFilteredUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2068" width="99" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="716" y="2083" style="text-anchor:start">-33.00%</text>
|
||||
</g>
|
||||
<text x="100" y="2088" style="text-anchor:start">BenchmarkNextFilteredUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2094" width="175" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="792" y="2109" style="text-anchor:start">-58.54%</text>
|
||||
</g>
|
||||
<text x="100" y="2114" style="text-anchor:start">BenchmarkPrevFilteredUntil</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2120" width="101" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="718" y="2135" style="text-anchor:start">-33.80%</text>
|
||||
</g>
|
||||
<text x="100" y="2140" style="text-anchor:start">BenchmarkPrevFilteredUntilSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2146" width="100" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="717" y="2161" style="text-anchor:start">-33.44%</text>
|
||||
</g>
|
||||
<text x="100" y="2166" style="text-anchor:start">BenchmarkPrevFilteredUntilNodes</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2172" width="74" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="691" y="2187" style="text-anchor:start">-24.82%</text>
|
||||
</g>
|
||||
<text x="100" y="2192" style="text-anchor:start">BenchmarkClosest</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2198" width="103" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="720" y="2213" style="text-anchor:start">-34.45%</text>
|
||||
</g>
|
||||
<text x="100" y="2218" style="text-anchor:start">BenchmarkClosestSelection</text>
|
||||
<g style="font-style:italic;font-size:75%">
|
||||
<rect x="612" y="2224" width="105" height="20" style="fill-opacity:0.3;fill:green"/>
|
||||
<text x="722" y="2239" style="text-anchor:start">-35.30%</text>
|
||||
</g>
|
||||
<text x="100" y="2244" style="text-anchor:start">BenchmarkClosestNodes</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,470 @@
|
||||
PASS
|
||||
BenchmarkFirst 20000000 96.3 ns/op
|
||||
BenchmarkLast 20000000 95.7 ns/op
|
||||
BenchmarkEq 20000000 97.1 ns/op
|
||||
BenchmarkSlice 20000000 92.3 ns/op
|
||||
BenchmarkGet 1000000000 2.06 ns/op
|
||||
BenchmarkIndex 1000000 1069 ns/op
|
||||
--- BENCH: BenchmarkIndex
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
BenchmarkIndexSelector 100000 26750 ns/op
|
||||
--- BENCH: BenchmarkIndexSelector
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
BenchmarkIndexOfNode 100000000 10.7 ns/op
|
||||
--- BENCH: BenchmarkIndexOfNode
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
BenchmarkIndexOfSelection 100000000 11.8 ns/op
|
||||
--- BENCH: BenchmarkIndexOfSelection
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
BenchmarkMetalReviewExample 10000 219078 ns/op
|
||||
--- BENCH: BenchmarkMetalReviewExample
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
|
||||
bench_example_test.go:41: MetalReviewExample=10
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
... [output truncated]
|
||||
BenchmarkAdd 100000 22345 ns/op
|
||||
--- BENCH: BenchmarkAdd
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
BenchmarkAddSelection 10000000 209 ns/op
|
||||
--- BENCH: BenchmarkAddSelection
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
BenchmarkAddNodes 10000000 209 ns/op
|
||||
--- BENCH: BenchmarkAddNodes
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
BenchmarkAndSelf 1000000 2568 ns/op
|
||||
--- BENCH: BenchmarkAndSelf
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
BenchmarkFilter 100000 26715 ns/op
|
||||
--- BENCH: BenchmarkFilter
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
BenchmarkNot 50000 30058 ns/op
|
||||
--- BENCH: BenchmarkNot
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
BenchmarkFilterFunction 50000 66346 ns/op
|
||||
--- BENCH: BenchmarkFilterFunction
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
BenchmarkNotFunction 50000 72646 ns/op
|
||||
--- BENCH: BenchmarkNotFunction
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
BenchmarkFilterNodes 50000 65493 ns/op
|
||||
--- BENCH: BenchmarkFilterNodes
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
BenchmarkNotNodes 20000 79466 ns/op
|
||||
--- BENCH: BenchmarkNotNodes
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
BenchmarkFilterSelection 50000 65494 ns/op
|
||||
--- BENCH: BenchmarkFilterSelection
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
BenchmarkNotSelection 20000 79387 ns/op
|
||||
--- BENCH: BenchmarkNotSelection
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
BenchmarkHas 5000 386571 ns/op
|
||||
--- BENCH: BenchmarkHas
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
BenchmarkHasNodes 10000 230664 ns/op
|
||||
--- BENCH: BenchmarkHasNodes
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
BenchmarkHasSelection 10000 230705 ns/op
|
||||
--- BENCH: BenchmarkHasSelection
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
BenchmarkEnd 500000000 4.61 ns/op
|
||||
--- BENCH: BenchmarkEnd
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
BenchmarkEach 200000 9520 ns/op
|
||||
--- BENCH: BenchmarkEach
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
BenchmarkMap 100000 15960 ns/op
|
||||
--- BENCH: BenchmarkMap
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
BenchmarkAttr 50000000 30.4 ns/op
|
||||
--- BENCH: BenchmarkAttr
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
BenchmarkText 100000 18718 ns/op
|
||||
BenchmarkLength 2000000000 0.31 ns/op
|
||||
--- BENCH: BenchmarkLength
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
BenchmarkHtml 5000000 606 ns/op
|
||||
BenchmarkIs 100000 29289 ns/op
|
||||
--- BENCH: BenchmarkIs
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
BenchmarkIsPositional 100000 23834 ns/op
|
||||
--- BENCH: BenchmarkIsPositional
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
BenchmarkIsFunction 1000000 2436 ns/op
|
||||
--- BENCH: BenchmarkIsFunction
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
BenchmarkIsSelection 50000 67106 ns/op
|
||||
--- BENCH: BenchmarkIsSelection
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
BenchmarkIsNodes 50000 66042 ns/op
|
||||
--- BENCH: BenchmarkIsNodes
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
BenchmarkHasClass 5000 565347 ns/op
|
||||
--- BENCH: BenchmarkHasClass
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
BenchmarkContains 100000000 11.0 ns/op
|
||||
--- BENCH: BenchmarkContains
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
BenchmarkFind 100000 27677 ns/op
|
||||
--- BENCH: BenchmarkFind
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
BenchmarkFindWithinSelection 50000 72162 ns/op
|
||||
--- BENCH: BenchmarkFindWithinSelection
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
BenchmarkFindSelection 5000 460124 ns/op
|
||||
--- BENCH: BenchmarkFindSelection
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
BenchmarkFindNodes 5000 459390 ns/op
|
||||
--- BENCH: BenchmarkFindNodes
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
BenchmarkContents 500000 3395 ns/op
|
||||
--- BENCH: BenchmarkContents
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
BenchmarkContentsFiltered 500000 5193 ns/op
|
||||
--- BENCH: BenchmarkContentsFiltered
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
BenchmarkChildren 5000000 667 ns/op
|
||||
--- BENCH: BenchmarkChildren
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
BenchmarkChildrenFiltered 500000 3591 ns/op
|
||||
--- BENCH: BenchmarkChildrenFiltered
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
BenchmarkParent 50000 43168 ns/op
|
||||
--- BENCH: BenchmarkParent
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
BenchmarkParentFiltered 50000 45836 ns/op
|
||||
--- BENCH: BenchmarkParentFiltered
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
BenchmarkParents 20000 92348 ns/op
|
||||
--- BENCH: BenchmarkParents
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
BenchmarkParentsFiltered 20000 95306 ns/op
|
||||
--- BENCH: BenchmarkParentsFiltered
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
BenchmarkParentsUntil 50000 72782 ns/op
|
||||
--- BENCH: BenchmarkParentsUntil
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
BenchmarkParentsUntilSelection 10000 157639 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilSelection
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
BenchmarkParentsUntilNodes 10000 157510 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilNodes
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
BenchmarkParentsFilteredUntil 100000 16987 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntil
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
BenchmarkParentsFilteredUntilSelection 100000 21174 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilSelection
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
BenchmarkParentsFilteredUntilNodes 100000 21238 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilNodes
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
BenchmarkSiblings 50000 66536 ns/op
|
||||
--- BENCH: BenchmarkSiblings
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
BenchmarkSiblingsFiltered 50000 71822 ns/op
|
||||
--- BENCH: BenchmarkSiblingsFiltered
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
BenchmarkNext 200000 10745 ns/op
|
||||
--- BENCH: BenchmarkNext
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
BenchmarkNextFiltered 200000 12399 ns/op
|
||||
--- BENCH: BenchmarkNextFiltered
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
BenchmarkNextAll 50000 44640 ns/op
|
||||
--- BENCH: BenchmarkNextAll
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
BenchmarkNextAllFiltered 50000 49713 ns/op
|
||||
--- BENCH: BenchmarkNextAllFiltered
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
BenchmarkPrev 200000 10743 ns/op
|
||||
--- BENCH: BenchmarkPrev
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
BenchmarkPrevFiltered 200000 12456 ns/op
|
||||
--- BENCH: BenchmarkPrevFiltered
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
BenchmarkPrevAll 100000 17600 ns/op
|
||||
--- BENCH: BenchmarkPrevAll
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
BenchmarkPrevAllFiltered 100000 19460 ns/op
|
||||
--- BENCH: BenchmarkPrevAllFiltered
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
BenchmarkNextUntil 20000 92630 ns/op
|
||||
--- BENCH: BenchmarkNextUntil
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
BenchmarkNextUntilSelection 50000 61285 ns/op
|
||||
--- BENCH: BenchmarkNextUntilSelection
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
BenchmarkNextUntilNodes 100000 25859 ns/op
|
||||
--- BENCH: BenchmarkNextUntilNodes
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
BenchmarkPrevUntil 10000 230236 ns/op
|
||||
--- BENCH: BenchmarkPrevUntil
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
BenchmarkPrevUntilSelection 20000 77837 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilSelection
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
BenchmarkPrevUntilNodes 100000 20784 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilNodes
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
BenchmarkNextFilteredUntil 50000 46147 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntil
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
BenchmarkNextFilteredUntilSelection 50000 67164 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilSelection
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
BenchmarkNextFilteredUntilNodes 50000 66628 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilNodes
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
BenchmarkPrevFilteredUntil 50000 46697 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntil
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
BenchmarkPrevFilteredUntilSelection 50000 68646 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilSelection
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
BenchmarkPrevFilteredUntilNodes 50000 68745 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilNodes
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
BenchmarkClosest 500000 4909 ns/op
|
||||
--- BENCH: BenchmarkClosest
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
BenchmarkClosestSelection 5000000 744 ns/op
|
||||
--- BENCH: BenchmarkClosestSelection
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
BenchmarkClosestNodes 5000000 733 ns/op
|
||||
--- BENCH: BenchmarkClosestNodes
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
ok github.com/PuerkitoBio/goquery 220.793s
|
||||
+476
@@ -0,0 +1,476 @@
|
||||
PASS
|
||||
BenchmarkFirst 20000000 95.5 ns/op
|
||||
BenchmarkLast 20000000 94.9 ns/op
|
||||
BenchmarkEq 20000000 95.7 ns/op
|
||||
BenchmarkSlice 20000000 91.7 ns/op
|
||||
BenchmarkGet 1000000000 2.05 ns/op
|
||||
BenchmarkIndex 1000000 1079 ns/op
|
||||
--- BENCH: BenchmarkIndex
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
bench_array_test.go:73: Index=3
|
||||
BenchmarkIndexSelector 100000 26972 ns/op
|
||||
--- BENCH: BenchmarkIndexSelector
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
bench_array_test.go:85: IndexSelector=4
|
||||
BenchmarkIndexOfNode 100000000 10.8 ns/op
|
||||
--- BENCH: BenchmarkIndexOfNode
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
bench_array_test.go:99: IndexOfNode=2
|
||||
BenchmarkIndexOfSelection 100000000 11.7 ns/op
|
||||
--- BENCH: BenchmarkIndexOfSelection
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
bench_array_test.go:111: IndexOfSelection=2
|
||||
BenchmarkMetalReviewExample 10000 213800 ns/op
|
||||
--- BENCH: BenchmarkMetalReviewExample
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
|
||||
bench_example_test.go:41: MetalReviewExample=10
|
||||
bench_example_test.go:40: Review 0: Midnight - Complete and Total Hell (8.5).
|
||||
Review 1: Over Your Threshold - Facticity (6.0).
|
||||
Review 2: Nuclear Death Terror - Chaos Reigns (7.5).
|
||||
Review 3: Evoken - Atra Mors (9.5).
|
||||
... [output truncated]
|
||||
BenchmarkAdd 100000 21811 ns/op
|
||||
--- BENCH: BenchmarkAdd
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
bench_expand_test.go:20: Add=43
|
||||
BenchmarkAddSelection 10000000 205 ns/op
|
||||
--- BENCH: BenchmarkAddSelection
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
bench_expand_test.go:37: AddSelection=43
|
||||
BenchmarkAddNodes 10000000 202 ns/op
|
||||
--- BENCH: BenchmarkAddNodes
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
bench_expand_test.go:55: AddNodes=43
|
||||
BenchmarkAndSelf 1000000 2467 ns/op
|
||||
--- BENCH: BenchmarkAndSelf
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
bench_expand_test.go:71: AndSelf=44
|
||||
BenchmarkFilter 100000 25643 ns/op
|
||||
--- BENCH: BenchmarkFilter
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
bench_filter_test.go:20: Filter=13
|
||||
BenchmarkNot 100000 29566 ns/op
|
||||
--- BENCH: BenchmarkNot
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
bench_filter_test.go:36: Not=371
|
||||
BenchmarkFilterFunction 50000 66894 ns/op
|
||||
--- BENCH: BenchmarkFilterFunction
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
bench_filter_test.go:55: FilterFunction=112
|
||||
BenchmarkNotFunction 50000 72183 ns/op
|
||||
--- BENCH: BenchmarkNotFunction
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
bench_filter_test.go:74: NotFunction=261
|
||||
BenchmarkFilterNodes 50000 65516 ns/op
|
||||
--- BENCH: BenchmarkFilterNodes
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
bench_filter_test.go:92: FilterNodes=2
|
||||
BenchmarkNotNodes 20000 78880 ns/op
|
||||
--- BENCH: BenchmarkNotNodes
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
bench_filter_test.go:110: NotNodes=360
|
||||
BenchmarkFilterSelection 50000 65232 ns/op
|
||||
--- BENCH: BenchmarkFilterSelection
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
bench_filter_test.go:127: FilterSelection=2
|
||||
BenchmarkNotSelection 20000 78813 ns/op
|
||||
--- BENCH: BenchmarkNotSelection
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
bench_filter_test.go:144: NotSelection=360
|
||||
BenchmarkHas 5000 388834 ns/op
|
||||
--- BENCH: BenchmarkHas
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
bench_filter_test.go:160: Has=13
|
||||
BenchmarkHasNodes 10000 228552 ns/op
|
||||
--- BENCH: BenchmarkHasNodes
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
bench_filter_test.go:178: HasNodes=15
|
||||
BenchmarkHasSelection 10000 228365 ns/op
|
||||
--- BENCH: BenchmarkHasSelection
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
bench_filter_test.go:195: HasSelection=15
|
||||
BenchmarkEnd 500000000 4.62 ns/op
|
||||
--- BENCH: BenchmarkEnd
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
bench_filter_test.go:211: End=373
|
||||
BenchmarkEach 200000 9548 ns/op
|
||||
--- BENCH: BenchmarkEach
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
bench_iteration_test.go:22: Each=59
|
||||
BenchmarkMap 100000 15900 ns/op
|
||||
--- BENCH: BenchmarkMap
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
bench_iteration_test.go:41: Map=59
|
||||
BenchmarkEachWithBreak 1000000 1650 ns/op
|
||||
--- BENCH: BenchmarkEachWithBreak
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
bench_iteration_test.go:61: Each=10
|
||||
BenchmarkAttr 50000000 30.5 ns/op
|
||||
--- BENCH: BenchmarkAttr
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
bench_property_test.go:16: Attr=firstHeading
|
||||
BenchmarkText 100000 18873 ns/op
|
||||
BenchmarkLength 2000000000 0.31 ns/op
|
||||
--- BENCH: BenchmarkLength
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
bench_property_test.go:37: Length=14
|
||||
BenchmarkHtml 5000000 616 ns/op
|
||||
BenchmarkIs 100000 29499 ns/op
|
||||
--- BENCH: BenchmarkIs
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
bench_query_test.go:16: Is=true
|
||||
BenchmarkIsPositional 100000 23733 ns/op
|
||||
--- BENCH: BenchmarkIsPositional
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
bench_query_test.go:28: IsPositional=true
|
||||
BenchmarkIsFunction 1000000 2404 ns/op
|
||||
--- BENCH: BenchmarkIsFunction
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
bench_query_test.go:43: IsFunction=true
|
||||
BenchmarkIsSelection 50000 65376 ns/op
|
||||
--- BENCH: BenchmarkIsSelection
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
bench_query_test.go:56: IsSelection=true
|
||||
BenchmarkIsNodes 50000 65322 ns/op
|
||||
--- BENCH: BenchmarkIsNodes
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
bench_query_test.go:70: IsNodes=true
|
||||
BenchmarkHasClass 5000 558933 ns/op
|
||||
--- BENCH: BenchmarkHasClass
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
bench_query_test.go:82: HasClass=true
|
||||
BenchmarkContains 100000000 11.1 ns/op
|
||||
--- BENCH: BenchmarkContains
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
bench_query_test.go:96: Contains=true
|
||||
BenchmarkFind 100000 27841 ns/op
|
||||
--- BENCH: BenchmarkFind
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
bench_traversal_test.go:18: Find=41
|
||||
BenchmarkFindWithinSelection 50000 72096 ns/op
|
||||
--- BENCH: BenchmarkFindWithinSelection
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
bench_traversal_test.go:34: FindWithinSelection=39
|
||||
BenchmarkFindSelection 5000 457349 ns/op
|
||||
--- BENCH: BenchmarkFindSelection
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
bench_traversal_test.go:51: FindSelection=73
|
||||
BenchmarkFindNodes 5000 459324 ns/op
|
||||
--- BENCH: BenchmarkFindNodes
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
bench_traversal_test.go:69: FindNodes=73
|
||||
BenchmarkContents 500000 3435 ns/op
|
||||
--- BENCH: BenchmarkContents
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
bench_traversal_test.go:85: Contents=16
|
||||
BenchmarkContentsFiltered 500000 5241 ns/op
|
||||
--- BENCH: BenchmarkContentsFiltered
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
bench_traversal_test.go:101: ContentsFiltered=1
|
||||
BenchmarkChildren 5000000 667 ns/op
|
||||
--- BENCH: BenchmarkChildren
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
bench_traversal_test.go:117: Children=2
|
||||
BenchmarkChildrenFiltered 500000 3639 ns/op
|
||||
--- BENCH: BenchmarkChildrenFiltered
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
bench_traversal_test.go:133: ChildrenFiltered=2
|
||||
BenchmarkParent 50000 44867 ns/op
|
||||
--- BENCH: BenchmarkParent
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
bench_traversal_test.go:149: Parent=55
|
||||
BenchmarkParentFiltered 50000 46476 ns/op
|
||||
--- BENCH: BenchmarkParentFiltered
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
bench_traversal_test.go:165: ParentFiltered=4
|
||||
BenchmarkParents 20000 92559 ns/op
|
||||
--- BENCH: BenchmarkParents
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
bench_traversal_test.go:181: Parents=73
|
||||
BenchmarkParentsFiltered 20000 96142 ns/op
|
||||
--- BENCH: BenchmarkParentsFiltered
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
bench_traversal_test.go:197: ParentsFiltered=18
|
||||
BenchmarkParentsUntil 50000 73931 ns/op
|
||||
--- BENCH: BenchmarkParentsUntil
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
bench_traversal_test.go:213: ParentsUntil=52
|
||||
BenchmarkParentsUntilSelection 10000 159820 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilSelection
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
bench_traversal_test.go:230: ParentsUntilSelection=70
|
||||
BenchmarkParentsUntilNodes 10000 158811 ns/op
|
||||
--- BENCH: BenchmarkParentsUntilNodes
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
bench_traversal_test.go:248: ParentsUntilNodes=70
|
||||
BenchmarkParentsFilteredUntil 100000 17203 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntil
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
bench_traversal_test.go:264: ParentsFilteredUntil=2
|
||||
BenchmarkParentsFilteredUntilSelection 100000 21358 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilSelection
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
bench_traversal_test.go:281: ParentsFilteredUntilSelection=2
|
||||
BenchmarkParentsFilteredUntilNodes 100000 21338 ns/op
|
||||
--- BENCH: BenchmarkParentsFilteredUntilNodes
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
bench_traversal_test.go:299: ParentsFilteredUntilNodes=2
|
||||
BenchmarkSiblings 50000 66463 ns/op
|
||||
--- BENCH: BenchmarkSiblings
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
bench_traversal_test.go:315: Siblings=293
|
||||
BenchmarkSiblingsFiltered 50000 72503 ns/op
|
||||
--- BENCH: BenchmarkSiblingsFiltered
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
bench_traversal_test.go:331: SiblingsFiltered=46
|
||||
BenchmarkNext 200000 10881 ns/op
|
||||
--- BENCH: BenchmarkNext
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
bench_traversal_test.go:347: Next=49
|
||||
BenchmarkNextFiltered 200000 12588 ns/op
|
||||
--- BENCH: BenchmarkNextFiltered
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
bench_traversal_test.go:363: NextFiltered=6
|
||||
BenchmarkNextAll 50000 45075 ns/op
|
||||
--- BENCH: BenchmarkNextAll
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
bench_traversal_test.go:379: NextAll=234
|
||||
BenchmarkNextAllFiltered 50000 50455 ns/op
|
||||
--- BENCH: BenchmarkNextAllFiltered
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
bench_traversal_test.go:395: NextAllFiltered=33
|
||||
BenchmarkPrev 200000 10933 ns/op
|
||||
--- BENCH: BenchmarkPrev
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
bench_traversal_test.go:411: Prev=49
|
||||
BenchmarkPrevFiltered 200000 12579 ns/op
|
||||
--- BENCH: BenchmarkPrevFiltered
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
bench_traversal_test.go:429: PrevFiltered=7
|
||||
BenchmarkPrevAll 100000 17751 ns/op
|
||||
--- BENCH: BenchmarkPrevAll
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
bench_traversal_test.go:445: PrevAll=78
|
||||
BenchmarkPrevAllFiltered 100000 19702 ns/op
|
||||
--- BENCH: BenchmarkPrevAllFiltered
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
bench_traversal_test.go:461: PrevAllFiltered=6
|
||||
BenchmarkNextUntil 20000 93586 ns/op
|
||||
--- BENCH: BenchmarkNextUntil
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
bench_traversal_test.go:477: NextUntil=84
|
||||
BenchmarkNextUntilSelection 50000 61155 ns/op
|
||||
--- BENCH: BenchmarkNextUntilSelection
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
bench_traversal_test.go:494: NextUntilSelection=42
|
||||
BenchmarkNextUntilNodes 100000 25805 ns/op
|
||||
--- BENCH: BenchmarkNextUntilNodes
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
bench_traversal_test.go:512: NextUntilNodes=12
|
||||
BenchmarkPrevUntil 10000 232225 ns/op
|
||||
--- BENCH: BenchmarkPrevUntil
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
bench_traversal_test.go:528: PrevUntil=238
|
||||
BenchmarkPrevUntilSelection 20000 78316 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilSelection
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
bench_traversal_test.go:545: PrevUntilSelection=49
|
||||
BenchmarkPrevUntilNodes 100000 20657 ns/op
|
||||
--- BENCH: BenchmarkPrevUntilNodes
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
bench_traversal_test.go:563: PrevUntilNodes=11
|
||||
BenchmarkNextFilteredUntil 50000 46567 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntil
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
bench_traversal_test.go:579: NextFilteredUntil=22
|
||||
BenchmarkNextFilteredUntilSelection 50000 67227 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilSelection
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
bench_traversal_test.go:596: NextFilteredUntilSelection=22
|
||||
BenchmarkNextFilteredUntilNodes 50000 66995 ns/op
|
||||
--- BENCH: BenchmarkNextFilteredUntilNodes
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
bench_traversal_test.go:614: NextFilteredUntilNodes=22
|
||||
BenchmarkPrevFilteredUntil 50000 47361 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntil
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
bench_traversal_test.go:630: PrevFilteredUntil=20
|
||||
BenchmarkPrevFilteredUntilSelection 50000 68802 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilSelection
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
bench_traversal_test.go:647: PrevFilteredUntilSelection=20
|
||||
BenchmarkPrevFilteredUntilNodes 50000 68928 ns/op
|
||||
--- BENCH: BenchmarkPrevFilteredUntilNodes
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
bench_traversal_test.go:665: PrevFilteredUntilNodes=20
|
||||
BenchmarkClosest 500000 4922 ns/op
|
||||
--- BENCH: BenchmarkClosest
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
bench_traversal_test.go:681: Closest=2
|
||||
BenchmarkClosestSelection 5000000 738 ns/op
|
||||
--- BENCH: BenchmarkClosestSelection
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
bench_traversal_test.go:698: ClosestSelection=2
|
||||
BenchmarkClosestNodes 5000000 737 ns/op
|
||||
--- BENCH: BenchmarkClosestNodes
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
bench_traversal_test.go:715: ClosestNodes=2
|
||||
ok github.com/PuerkitoBio/goquery 224.003s
|
||||
@@ -0,0 +1,112 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkFirst(b *testing.B) {
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("dd")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
sel.First()
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkLast(b *testing.B) {
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("dd")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
sel.Last()
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkEq(b *testing.B) {
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("dd")
|
||||
j := 0
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
sel.Eq(j)
|
||||
if j++; j >= sel.Length() {
|
||||
j = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkSlice(b *testing.B) {
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("dd")
|
||||
j := 0
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
sel.Slice(j, j+4)
|
||||
if j++; j >= (sel.Length() - 4) {
|
||||
j = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkGet(b *testing.B) {
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("dd")
|
||||
j := 0
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
sel.Get(j)
|
||||
if j++; j >= sel.Length() {
|
||||
j = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkIndex(b *testing.B) {
|
||||
var j int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("#Main")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
j = sel.Index()
|
||||
}
|
||||
b.Logf("Index=%d", j)
|
||||
}
|
||||
|
||||
func BenchmarkIndexSelector(b *testing.B) {
|
||||
var j int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("#manual-nav dl dd:nth-child(1)")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
j = sel.IndexSelector("dd")
|
||||
}
|
||||
b.Logf("IndexSelector=%d", j)
|
||||
}
|
||||
|
||||
func BenchmarkIndexOfNode(b *testing.B) {
|
||||
var j int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("span a")
|
||||
sel2 := DocB().Find("span a:nth-child(3)")
|
||||
n := sel2.Get(0)
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
j = sel.IndexOfNode(n)
|
||||
}
|
||||
b.Logf("IndexOfNode=%d", j)
|
||||
}
|
||||
|
||||
func BenchmarkIndexOfSelection(b *testing.B) {
|
||||
var j int
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("span a")
|
||||
sel2 := DocB().Find("span a:nth-child(3)")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
j = sel.IndexOfSelection(sel2)
|
||||
}
|
||||
b.Logf("IndexOfSelection=%d", j)
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkMetalReviewExample(b *testing.B) {
|
||||
var n int
|
||||
var buf bytes.Buffer
|
||||
|
||||
b.StopTimer()
|
||||
doc := LoadDoc("metalreview.html")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
doc.Find(".slider-row:nth-child(1) .slider-item").Each(func(i int, s *Selection) {
|
||||
var band, title string
|
||||
var score float64
|
||||
var e error
|
||||
|
||||
n++
|
||||
// For each item found, get the band, title and score, and print it
|
||||
band = s.Find("strong").Text()
|
||||
title = s.Find("em").Text()
|
||||
if score, e = strconv.ParseFloat(s.Find(".score").Text(), 64); e != nil {
|
||||
// Not a valid float, ignore score
|
||||
if n <= 4 {
|
||||
buf.WriteString(fmt.Sprintf("Review %d: %s - %s.\n", i, band, title))
|
||||
}
|
||||
} else {
|
||||
// Print all, including score
|
||||
if n <= 4 {
|
||||
buf.WriteString(fmt.Sprintf("Review %d: %s - %s (%2.1f).\n", i, band, title, score))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
b.Log(buf.String())
|
||||
b.Logf("MetalReviewExample=%d", n)
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkAdd(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("dd")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Add("h2[title]").Length()
|
||||
} else {
|
||||
sel.Add("h2[title]")
|
||||
}
|
||||
}
|
||||
b.Logf("Add=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkAddSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("dd")
|
||||
sel2 := DocB().Find("h2[title]")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.AddSelection(sel2).Length()
|
||||
} else {
|
||||
sel.AddSelection(sel2)
|
||||
}
|
||||
}
|
||||
b.Logf("AddSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkAddNodes(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("dd")
|
||||
sel2 := DocB().Find("h2[title]")
|
||||
nodes := sel2.Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.AddNodes(nodes...).Length()
|
||||
} else {
|
||||
sel.AddNodes(nodes...)
|
||||
}
|
||||
}
|
||||
b.Logf("AddNodes=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkAndSelf(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocB().Find("dd").Parent()
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.AndSelf().Length()
|
||||
} else {
|
||||
sel.AndSelf()
|
||||
}
|
||||
}
|
||||
b.Logf("AndSelf=%d", n)
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkFilter(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Filter(".toclevel-1").Length()
|
||||
} else {
|
||||
sel.Filter(".toclevel-1")
|
||||
}
|
||||
}
|
||||
b.Logf("Filter=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNot(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Not(".toclevel-2").Length()
|
||||
} else {
|
||||
sel.Filter(".toclevel-2")
|
||||
}
|
||||
}
|
||||
b.Logf("Not=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkFilterFunction(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
f := func(i int, s *Selection) bool {
|
||||
return len(s.Get(0).Attr) > 0
|
||||
}
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.FilterFunction(f).Length()
|
||||
} else {
|
||||
sel.FilterFunction(f)
|
||||
}
|
||||
}
|
||||
b.Logf("FilterFunction=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNotFunction(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
f := func(i int, s *Selection) bool {
|
||||
return len(s.Get(0).Attr) > 0
|
||||
}
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.NotFunction(f).Length()
|
||||
} else {
|
||||
sel.NotFunction(f)
|
||||
}
|
||||
}
|
||||
b.Logf("NotFunction=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkFilterNodes(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
sel2 := DocW().Find(".toclevel-2")
|
||||
nodes := sel2.Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.FilterNodes(nodes...).Length()
|
||||
} else {
|
||||
sel.FilterNodes(nodes...)
|
||||
}
|
||||
}
|
||||
b.Logf("FilterNodes=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNotNodes(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
sel2 := DocW().Find(".toclevel-1")
|
||||
nodes := sel2.Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.NotNodes(nodes...).Length()
|
||||
} else {
|
||||
sel.NotNodes(nodes...)
|
||||
}
|
||||
}
|
||||
b.Logf("NotNodes=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkFilterSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
sel2 := DocW().Find(".toclevel-2")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.FilterSelection(sel2).Length()
|
||||
} else {
|
||||
sel.FilterSelection(sel2)
|
||||
}
|
||||
}
|
||||
b.Logf("FilterSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNotSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
sel2 := DocW().Find(".toclevel-1")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.NotSelection(sel2).Length()
|
||||
} else {
|
||||
sel.NotSelection(sel2)
|
||||
}
|
||||
}
|
||||
b.Logf("NotSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkHas(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Has(".editsection").Length()
|
||||
} else {
|
||||
sel.Has(".editsection")
|
||||
}
|
||||
}
|
||||
b.Logf("Has=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkHasNodes(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
sel2 := DocW().Find(".tocnumber")
|
||||
nodes := sel2.Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.HasNodes(nodes...).Length()
|
||||
} else {
|
||||
sel.HasNodes(nodes...)
|
||||
}
|
||||
}
|
||||
b.Logf("HasNodes=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkHasSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
sel2 := DocW().Find(".tocnumber")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.HasSelection(sel2).Length()
|
||||
} else {
|
||||
sel.HasSelection(sel2)
|
||||
}
|
||||
}
|
||||
b.Logf("HasSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkEnd(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li").Has(".tocnumber")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.End().Length()
|
||||
} else {
|
||||
sel.End()
|
||||
}
|
||||
}
|
||||
b.Logf("End=%d", n)
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkEach(b *testing.B) {
|
||||
var tmp, n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("td")
|
||||
f := func(i int, s *Selection) {
|
||||
tmp++
|
||||
}
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
sel.Each(f)
|
||||
if n == 0 {
|
||||
n = tmp
|
||||
}
|
||||
}
|
||||
b.Logf("Each=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkMap(b *testing.B) {
|
||||
var tmp, n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("td")
|
||||
f := func(i int, s *Selection) string {
|
||||
tmp++
|
||||
return string(tmp)
|
||||
}
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
sel.Map(f)
|
||||
if n == 0 {
|
||||
n = tmp
|
||||
}
|
||||
}
|
||||
b.Logf("Map=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkEachWithBreak(b *testing.B) {
|
||||
var tmp, n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("td")
|
||||
f := func(i int, s *Selection) bool {
|
||||
tmp++
|
||||
return tmp < 10
|
||||
}
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
tmp = 0
|
||||
sel.EachWithBreak(f)
|
||||
if n == 0 {
|
||||
n = tmp
|
||||
}
|
||||
}
|
||||
b.Logf("Each=%d", n)
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkAttr(b *testing.B) {
|
||||
var s string
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h1")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
s, _ = sel.Attr("id")
|
||||
}
|
||||
b.Logf("Attr=%s", s)
|
||||
}
|
||||
|
||||
func BenchmarkText(b *testing.B) {
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
sel.Text()
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkLength(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
n = sel.Length()
|
||||
}
|
||||
b.Logf("Length=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkHtml(b *testing.B) {
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
sel.Html()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkIs(b *testing.B) {
|
||||
var y bool
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
y = sel.Is(".toclevel-2")
|
||||
}
|
||||
b.Logf("Is=%v", y)
|
||||
}
|
||||
|
||||
func BenchmarkIsPositional(b *testing.B) {
|
||||
var y bool
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
y = sel.Is("li:nth-child(2)")
|
||||
}
|
||||
b.Logf("IsPositional=%v", y)
|
||||
}
|
||||
|
||||
func BenchmarkIsFunction(b *testing.B) {
|
||||
var y bool
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find(".toclevel-1")
|
||||
f := func(i int, s *Selection) bool {
|
||||
return i == 8
|
||||
}
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
y = sel.IsFunction(f)
|
||||
}
|
||||
b.Logf("IsFunction=%v", y)
|
||||
}
|
||||
|
||||
func BenchmarkIsSelection(b *testing.B) {
|
||||
var y bool
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
sel2 := DocW().Find(".toclevel-2")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
y = sel.IsSelection(sel2)
|
||||
}
|
||||
b.Logf("IsSelection=%v", y)
|
||||
}
|
||||
|
||||
func BenchmarkIsNodes(b *testing.B) {
|
||||
var y bool
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
sel2 := DocW().Find(".toclevel-2")
|
||||
nodes := sel2.Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
y = sel.IsNodes(nodes...)
|
||||
}
|
||||
b.Logf("IsNodes=%v", y)
|
||||
}
|
||||
|
||||
func BenchmarkHasClass(b *testing.B) {
|
||||
var y bool
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("span")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
y = sel.HasClass("official")
|
||||
}
|
||||
b.Logf("HasClass=%v", y)
|
||||
}
|
||||
|
||||
func BenchmarkContains(b *testing.B) {
|
||||
var y bool
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("span.url")
|
||||
sel2 := DocW().Find("a[rel=\"nofollow\"]")
|
||||
node := sel2.Nodes[0]
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
y = sel.Contains(node)
|
||||
}
|
||||
b.Logf("Contains=%v", y)
|
||||
}
|
||||
@@ -0,0 +1,716 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkFind(b *testing.B) {
|
||||
var n int
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = DocB().Find("dd").Length()
|
||||
|
||||
} else {
|
||||
DocB().Find("dd")
|
||||
}
|
||||
}
|
||||
b.Logf("Find=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkFindWithinSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("ul")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Find("a[class]").Length()
|
||||
} else {
|
||||
sel.Find("a[class]")
|
||||
}
|
||||
}
|
||||
b.Logf("FindWithinSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkFindSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("ul")
|
||||
sel2 := DocW().Find("span")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.FindSelection(sel2).Length()
|
||||
} else {
|
||||
sel.FindSelection(sel2)
|
||||
}
|
||||
}
|
||||
b.Logf("FindSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkFindNodes(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("ul")
|
||||
sel2 := DocW().Find("span")
|
||||
nodes := sel2.Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.FindNodes(nodes...).Length()
|
||||
} else {
|
||||
sel.FindNodes(nodes...)
|
||||
}
|
||||
}
|
||||
b.Logf("FindNodes=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkContents(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find(".toclevel-1")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Contents().Length()
|
||||
} else {
|
||||
sel.Contents()
|
||||
}
|
||||
}
|
||||
b.Logf("Contents=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkContentsFiltered(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find(".toclevel-1")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.ContentsFiltered("a[href=\"#Examples\"]").Length()
|
||||
} else {
|
||||
sel.ContentsFiltered("a[href=\"#Examples\"]")
|
||||
}
|
||||
}
|
||||
b.Logf("ContentsFiltered=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkChildren(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find(".toclevel-2")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Children().Length()
|
||||
} else {
|
||||
sel.Children()
|
||||
}
|
||||
}
|
||||
b.Logf("Children=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkChildrenFiltered(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h3")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.ChildrenFiltered(".editsection").Length()
|
||||
} else {
|
||||
sel.ChildrenFiltered(".editsection")
|
||||
}
|
||||
}
|
||||
b.Logf("ChildrenFiltered=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkParent(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Parent().Length()
|
||||
} else {
|
||||
sel.Parent()
|
||||
}
|
||||
}
|
||||
b.Logf("Parent=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkParentFiltered(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.ParentFiltered("ul[id]").Length()
|
||||
} else {
|
||||
sel.ParentFiltered("ul[id]")
|
||||
}
|
||||
}
|
||||
b.Logf("ParentFiltered=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkParents(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("th a")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Parents().Length()
|
||||
} else {
|
||||
sel.Parents()
|
||||
}
|
||||
}
|
||||
b.Logf("Parents=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkParentsFiltered(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("th a")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.ParentsFiltered("tr").Length()
|
||||
} else {
|
||||
sel.ParentsFiltered("tr")
|
||||
}
|
||||
}
|
||||
b.Logf("ParentsFiltered=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkParentsUntil(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("th a")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.ParentsUntil("table").Length()
|
||||
} else {
|
||||
sel.ParentsUntil("table")
|
||||
}
|
||||
}
|
||||
b.Logf("ParentsUntil=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkParentsUntilSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("th a")
|
||||
sel2 := DocW().Find("#content")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.ParentsUntilSelection(sel2).Length()
|
||||
} else {
|
||||
sel.ParentsUntilSelection(sel2)
|
||||
}
|
||||
}
|
||||
b.Logf("ParentsUntilSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkParentsUntilNodes(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("th a")
|
||||
sel2 := DocW().Find("#content")
|
||||
nodes := sel2.Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.ParentsUntilNodes(nodes...).Length()
|
||||
} else {
|
||||
sel.ParentsUntilNodes(nodes...)
|
||||
}
|
||||
}
|
||||
b.Logf("ParentsUntilNodes=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkParentsFilteredUntil(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find(".toclevel-1 a")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.ParentsFilteredUntil(":nth-child(1)", "ul").Length()
|
||||
} else {
|
||||
sel.ParentsFilteredUntil(":nth-child(1)", "ul")
|
||||
}
|
||||
}
|
||||
b.Logf("ParentsFilteredUntil=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkParentsFilteredUntilSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find(".toclevel-1 a")
|
||||
sel2 := DocW().Find("ul")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.ParentsFilteredUntilSelection(":nth-child(1)", sel2).Length()
|
||||
} else {
|
||||
sel.ParentsFilteredUntilSelection(":nth-child(1)", sel2)
|
||||
}
|
||||
}
|
||||
b.Logf("ParentsFilteredUntilSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkParentsFilteredUntilNodes(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find(".toclevel-1 a")
|
||||
sel2 := DocW().Find("ul")
|
||||
nodes := sel2.Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.ParentsFilteredUntilNodes(":nth-child(1)", nodes...).Length()
|
||||
} else {
|
||||
sel.ParentsFilteredUntilNodes(":nth-child(1)", nodes...)
|
||||
}
|
||||
}
|
||||
b.Logf("ParentsFilteredUntilNodes=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkSiblings(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("ul li:nth-child(1)")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Siblings().Length()
|
||||
} else {
|
||||
sel.Siblings()
|
||||
}
|
||||
}
|
||||
b.Logf("Siblings=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkSiblingsFiltered(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("ul li:nth-child(1)")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.SiblingsFiltered("[class]").Length()
|
||||
} else {
|
||||
sel.SiblingsFiltered("[class]")
|
||||
}
|
||||
}
|
||||
b.Logf("SiblingsFiltered=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNext(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li:nth-child(1)")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Next().Length()
|
||||
} else {
|
||||
sel.Next()
|
||||
}
|
||||
}
|
||||
b.Logf("Next=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNextFiltered(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li:nth-child(1)")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.NextFiltered("[class]").Length()
|
||||
} else {
|
||||
sel.NextFiltered("[class]")
|
||||
}
|
||||
}
|
||||
b.Logf("NextFiltered=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNextAll(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li:nth-child(3)")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.NextAll().Length()
|
||||
} else {
|
||||
sel.NextAll()
|
||||
}
|
||||
}
|
||||
b.Logf("NextAll=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNextAllFiltered(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li:nth-child(3)")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.NextAllFiltered("[class]").Length()
|
||||
} else {
|
||||
sel.NextAllFiltered("[class]")
|
||||
}
|
||||
}
|
||||
b.Logf("NextAllFiltered=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkPrev(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li:last-child")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Prev().Length()
|
||||
} else {
|
||||
sel.Prev()
|
||||
}
|
||||
}
|
||||
b.Logf("Prev=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkPrevFiltered(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li:last-child")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.PrevFiltered("[class]").Length()
|
||||
} else {
|
||||
sel.PrevFiltered("[class]")
|
||||
}
|
||||
}
|
||||
// There is one more Prev li with a class, compared to Next li with a class
|
||||
// (confirmed by looking at the HTML, this is ok)
|
||||
b.Logf("PrevFiltered=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkPrevAll(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li:nth-child(4)")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.PrevAll().Length()
|
||||
} else {
|
||||
sel.PrevAll()
|
||||
}
|
||||
}
|
||||
b.Logf("PrevAll=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkPrevAllFiltered(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li:nth-child(4)")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.PrevAllFiltered("[class]").Length()
|
||||
} else {
|
||||
sel.PrevAllFiltered("[class]")
|
||||
}
|
||||
}
|
||||
b.Logf("PrevAllFiltered=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNextUntil(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li:first-child")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.NextUntil(":nth-child(4)").Length()
|
||||
} else {
|
||||
sel.NextUntil(":nth-child(4)")
|
||||
}
|
||||
}
|
||||
b.Logf("NextUntil=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNextUntilSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
sel2 := DocW().Find("ul")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.NextUntilSelection(sel2).Length()
|
||||
} else {
|
||||
sel.NextUntilSelection(sel2)
|
||||
}
|
||||
}
|
||||
b.Logf("NextUntilSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNextUntilNodes(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
sel2 := DocW().Find("p")
|
||||
nodes := sel2.Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.NextUntilNodes(nodes...).Length()
|
||||
} else {
|
||||
sel.NextUntilNodes(nodes...)
|
||||
}
|
||||
}
|
||||
b.Logf("NextUntilNodes=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkPrevUntil(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("li:last-child")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.PrevUntil(":nth-child(4)").Length()
|
||||
} else {
|
||||
sel.PrevUntil(":nth-child(4)")
|
||||
}
|
||||
}
|
||||
b.Logf("PrevUntil=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkPrevUntilSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
sel2 := DocW().Find("ul")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.PrevUntilSelection(sel2).Length()
|
||||
} else {
|
||||
sel.PrevUntilSelection(sel2)
|
||||
}
|
||||
}
|
||||
b.Logf("PrevUntilSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkPrevUntilNodes(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
sel2 := DocW().Find("p")
|
||||
nodes := sel2.Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.PrevUntilNodes(nodes...).Length()
|
||||
} else {
|
||||
sel.PrevUntilNodes(nodes...)
|
||||
}
|
||||
}
|
||||
b.Logf("PrevUntilNodes=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNextFilteredUntil(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.NextFilteredUntil("p", "div").Length()
|
||||
} else {
|
||||
sel.NextFilteredUntil("p", "div")
|
||||
}
|
||||
}
|
||||
b.Logf("NextFilteredUntil=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNextFilteredUntilSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
sel2 := DocW().Find("div")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.NextFilteredUntilSelection("p", sel2).Length()
|
||||
} else {
|
||||
sel.NextFilteredUntilSelection("p", sel2)
|
||||
}
|
||||
}
|
||||
b.Logf("NextFilteredUntilSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkNextFilteredUntilNodes(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
sel2 := DocW().Find("div")
|
||||
nodes := sel2.Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.NextFilteredUntilNodes("p", nodes...).Length()
|
||||
} else {
|
||||
sel.NextFilteredUntilNodes("p", nodes...)
|
||||
}
|
||||
}
|
||||
b.Logf("NextFilteredUntilNodes=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkPrevFilteredUntil(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.PrevFilteredUntil("p", "div").Length()
|
||||
} else {
|
||||
sel.PrevFilteredUntil("p", "div")
|
||||
}
|
||||
}
|
||||
b.Logf("PrevFilteredUntil=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkPrevFilteredUntilSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
sel2 := DocW().Find("div")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.PrevFilteredUntilSelection("p", sel2).Length()
|
||||
} else {
|
||||
sel.PrevFilteredUntilSelection("p", sel2)
|
||||
}
|
||||
}
|
||||
b.Logf("PrevFilteredUntilSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkPrevFilteredUntilNodes(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := DocW().Find("h2")
|
||||
sel2 := DocW().Find("div")
|
||||
nodes := sel2.Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.PrevFilteredUntilNodes("p", nodes...).Length()
|
||||
} else {
|
||||
sel.PrevFilteredUntilNodes("p", nodes...)
|
||||
}
|
||||
}
|
||||
b.Logf("PrevFilteredUntilNodes=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkClosest(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := Doc().Find(".container-fluid")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.Closest(".pvk-content").Length()
|
||||
} else {
|
||||
sel.Closest(".pvk-content")
|
||||
}
|
||||
}
|
||||
b.Logf("Closest=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkClosestSelection(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := Doc().Find(".pvk-content")
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.ClosestSelection(sel2).Length()
|
||||
} else {
|
||||
sel.ClosestSelection(sel2)
|
||||
}
|
||||
}
|
||||
b.Logf("ClosestSelection=%d", n)
|
||||
}
|
||||
|
||||
func BenchmarkClosestNodes(b *testing.B) {
|
||||
var n int
|
||||
|
||||
b.StopTimer()
|
||||
sel := Doc().Find(".container-fluid")
|
||||
nodes := Doc().Find(".pvk-content").Nodes
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if n == 0 {
|
||||
n = sel.ClosestNodes(nodes...).Length()
|
||||
} else {
|
||||
sel.ClosestNodes(nodes...)
|
||||
}
|
||||
}
|
||||
b.Logf("ClosestNodes=%d", n)
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2012, Martin Angers & Contributors
|
||||
// Copyright (c) 2012-2013, Martin Angers & Contributors
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
@@ -25,17 +25,12 @@
|
||||
Package goquery implements features similar to jQuery, including the chainable
|
||||
syntax, to manipulate and query an HTML document (the modification functions of jQuery are not included).
|
||||
|
||||
It depends on Go's experimental html package, which must be installed so that it
|
||||
can be imported as "exp/html". See this tutorial on how to install it
|
||||
accordingly: http://code.google.com/p/go-wiki/wiki/InstallingExp
|
||||
|
||||
It uses Cascadia as CSS selector (similar to Sizzle for jQuery). This dependency
|
||||
is automatically installed when using "go get ..." to install GoQuery.
|
||||
It uses Cascadia as CSS selector (similar to Sizzle for jQuery).
|
||||
|
||||
To provide a chainable interface, error management is strict, and goquery panics
|
||||
if an invalid Cascadia selector is used (this is consistent with the behavior of
|
||||
jQuery/Sizzle/document.querySelectorAll, where an error is thrown). This is
|
||||
necessary since multiple return values cannot be used to allow a chainable
|
||||
necessary since multiple return values cannot be used to allow a chainable
|
||||
interface.
|
||||
|
||||
It is hosted on GitHub, along with additional documentation in the README.md
|
||||
@@ -65,6 +60,7 @@ The various methods are split into files based on the category of behavior:
|
||||
|
||||
* iteration.go : methods to loop over the selection's nodes.
|
||||
- Each()
|
||||
- EachWithBreak()
|
||||
- Map()
|
||||
|
||||
* property.go : methods that inspect and get the node's properties values.
|
||||
|
||||
+2
-1
@@ -14,12 +14,13 @@ func ExampleScrape_MetalReview() {
|
||||
// Load the HTML document (in real use, the type would be *goquery.Document)
|
||||
var doc *Document
|
||||
var e error
|
||||
|
||||
if doc, e = NewDocument("http://metalreview.com"); e != nil {
|
||||
panic(e.Error())
|
||||
}
|
||||
|
||||
// Find the review items (the type of the Selection would be *goquery.Selection)
|
||||
doc.Root.Find(".slider-row:nth-child(1) .slider-item").Each(func(i int, s *Selection) {
|
||||
doc.Find(".slider-row:nth-child(1) .slider-item").Each(func(i int, s *Selection) {
|
||||
var band, title string
|
||||
var score float64
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"exp/html"
|
||||
"code.google.com/p/go.net/html"
|
||||
)
|
||||
|
||||
// Add() adds the selector string's matching nodes to those in the current
|
||||
|
||||
+12
-12
@@ -5,25 +5,25 @@ import (
|
||||
)
|
||||
|
||||
func TestAdd(t *testing.T) {
|
||||
sel := Doc().Root.Find("div.row-fluid").Add("a")
|
||||
sel := Doc().Find("div.row-fluid").Add("a")
|
||||
AssertLength(t, sel.Nodes, 19)
|
||||
}
|
||||
|
||||
func TestAddRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Add("a").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestAddSelection(t *testing.T) {
|
||||
sel := Doc().Root.Find("div.row-fluid")
|
||||
sel2 := Doc().Root.Find("a")
|
||||
sel := Doc().Find("div.row-fluid")
|
||||
sel2 := Doc().Find("a")
|
||||
sel = sel.AddSelection(sel2)
|
||||
AssertLength(t, sel.Nodes, 19)
|
||||
}
|
||||
|
||||
func TestAddSelectionNil(t *testing.T) {
|
||||
sel := Doc().Root.Find("div.row-fluid")
|
||||
sel := Doc().Find("div.row-fluid")
|
||||
AssertLength(t, sel.Nodes, 9)
|
||||
|
||||
sel = sel.AddSelection(nil)
|
||||
@@ -31,38 +31,38 @@ func TestAddSelectionNil(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAddSelectionRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Find("a")
|
||||
sel2 = sel.AddSelection(sel2).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestAddNodes(t *testing.T) {
|
||||
sel := Doc().Root.Find("div.pvk-gutter")
|
||||
sel2 := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find("div.pvk-gutter")
|
||||
sel2 := Doc().Find(".pvk-content")
|
||||
sel = sel.AddNodes(sel2.Nodes...)
|
||||
AssertLength(t, sel.Nodes, 9)
|
||||
}
|
||||
|
||||
func TestAddNodesNone(t *testing.T) {
|
||||
sel := Doc().Root.Find("div.pvk-gutter").AddNodes()
|
||||
sel := Doc().Find("div.pvk-gutter").AddNodes()
|
||||
AssertLength(t, sel.Nodes, 6)
|
||||
}
|
||||
|
||||
func TestAddNodesRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Find("a")
|
||||
sel2 = sel.AddNodes(sel2.Nodes...).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestAndSelf(t *testing.T) {
|
||||
sel := Doc().Root.Find(".span12").Last().AndSelf()
|
||||
sel := Doc().Find(".span12").Last().AndSelf()
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
}
|
||||
|
||||
func TestAndSelfRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Find("a").AndSelf().End().End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package goquery
|
||||
|
||||
import (
|
||||
"code.google.com/p/cascadia"
|
||||
"exp/html"
|
||||
"code.google.com/p/go.net/html"
|
||||
)
|
||||
|
||||
// Filter() reduces the set of matched elements to those that match the selector string.
|
||||
@@ -70,7 +70,7 @@ func (this *Selection) Intersection(s *Selection) *Selection {
|
||||
// that matches the selector.
|
||||
// It returns a new Selection object with the matching elements.
|
||||
func (this *Selection) Has(selector string) *Selection {
|
||||
return this.HasSelection(this.document.Root.Find(selector))
|
||||
return this.HasSelection(this.document.Find(selector))
|
||||
}
|
||||
|
||||
// HasNodes() reduces the set of matched elements to those that have a
|
||||
|
||||
+39
-39
@@ -5,30 +5,30 @@ import (
|
||||
)
|
||||
|
||||
func TestFilter(t *testing.T) {
|
||||
sel := Doc().Root.Find(".span12").Filter(".alert")
|
||||
sel := Doc().Find(".span12").Filter(".alert")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestFilterNone(t *testing.T) {
|
||||
sel := Doc().Root.Find(".span12").Filter(".zzalert")
|
||||
sel := Doc().Find(".span12").Filter(".zzalert")
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestFilterRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Filter(".alert").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestFilterFunction(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content").FilterFunction(func(i int, s *Selection) bool {
|
||||
sel := Doc().Find(".pvk-content").FilterFunction(func(i int, s *Selection) bool {
|
||||
return i > 0
|
||||
})
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
}
|
||||
|
||||
func TestFilterFunctionRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.FilterFunction(func(i int, s *Selection) bool {
|
||||
return i > 0
|
||||
}).End()
|
||||
@@ -36,27 +36,27 @@ func TestFilterFunctionRollback(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFilterNode(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.FilterNodes(sel.Nodes[2])
|
||||
AssertLength(t, sel2.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestFilterNodeRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.FilterNodes(sel.Nodes[2]).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestFilterSelection(t *testing.T) {
|
||||
sel := Doc().Root.Find(".link")
|
||||
sel2 := Doc().Root.Find("a[ng-click]")
|
||||
sel := Doc().Find(".link")
|
||||
sel2 := Doc().Find("a[ng-click]")
|
||||
sel3 := sel.FilterSelection(sel2)
|
||||
AssertLength(t, sel3.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestFilterSelectionRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".link")
|
||||
sel2 := Doc().Root.Find("a[ng-click]")
|
||||
sel := Doc().Find(".link")
|
||||
sel2 := Doc().Find("a[ng-click]")
|
||||
sel2 = sel.FilterSelection(sel2).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
@@ -64,36 +64,36 @@ func TestFilterSelectionRollback(t *testing.T) {
|
||||
func TestFilterSelectionNil(t *testing.T) {
|
||||
var sel2 *Selection
|
||||
|
||||
sel := Doc().Root.Find(".link")
|
||||
sel := Doc().Find(".link")
|
||||
sel3 := sel.FilterSelection(sel2)
|
||||
AssertLength(t, sel3.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestNot(t *testing.T) {
|
||||
sel := Doc().Root.Find(".span12").Not(".alert")
|
||||
sel := Doc().Find(".span12").Not(".alert")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestNotRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".span12")
|
||||
sel := Doc().Find(".span12")
|
||||
sel2 := sel.Not(".alert").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNotNone(t *testing.T) {
|
||||
sel := Doc().Root.Find(".span12").Not(".zzalert")
|
||||
sel := Doc().Find(".span12").Not(".zzalert")
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
}
|
||||
|
||||
func TestNotFunction(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content").NotFunction(func(i int, s *Selection) bool {
|
||||
sel := Doc().Find(".pvk-content").NotFunction(func(i int, s *Selection) bool {
|
||||
return i > 0
|
||||
})
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestNotFunctionRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.NotFunction(func(i int, s *Selection) bool {
|
||||
return i > 0
|
||||
}).End()
|
||||
@@ -101,91 +101,91 @@ func TestNotFunctionRollback(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNotNode(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.NotNodes(sel.Nodes[2])
|
||||
AssertLength(t, sel2.Nodes, 2)
|
||||
}
|
||||
|
||||
func TestNotNodeRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.NotNodes(sel.Nodes[2]).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNotSelection(t *testing.T) {
|
||||
sel := Doc().Root.Find(".link")
|
||||
sel2 := Doc().Root.Find("a[ng-click]")
|
||||
sel := Doc().Find(".link")
|
||||
sel2 := Doc().Find("a[ng-click]")
|
||||
sel3 := sel.NotSelection(sel2)
|
||||
AssertLength(t, sel3.Nodes, 6)
|
||||
}
|
||||
|
||||
func TestNotSelectionRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".link")
|
||||
sel2 := Doc().Root.Find("a[ng-click]")
|
||||
sel := Doc().Find(".link")
|
||||
sel2 := Doc().Find("a[ng-click]")
|
||||
sel2 = sel.NotSelection(sel2).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestIntersection(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-gutter")
|
||||
sel2 := Doc().Root.Find("div").Intersection(sel)
|
||||
sel := Doc().Find(".pvk-gutter")
|
||||
sel2 := Doc().Find("div").Intersection(sel)
|
||||
AssertLength(t, sel2.Nodes, 6)
|
||||
}
|
||||
|
||||
func TestIntersectionRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-gutter")
|
||||
sel2 := Doc().Root.Find("div")
|
||||
sel := Doc().Find(".pvk-gutter")
|
||||
sel2 := Doc().Find("div")
|
||||
sel2 = sel.Intersection(sel2).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestHas(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid").Has(".center-content")
|
||||
sel := Doc().Find(".container-fluid").Has(".center-content")
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
// Has() returns the high-level .container-fluid div, and the one that is the immediate parent of center-content
|
||||
}
|
||||
|
||||
func TestHasRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.Has(".center-content").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestHasNodes(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel2 := Doc().Root.Find(".center-content")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := Doc().Find(".center-content")
|
||||
sel = sel.HasNodes(sel2.Nodes...)
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
// Has() returns the high-level .container-fluid div, and the one that is the immediate parent of center-content
|
||||
}
|
||||
|
||||
func TestHasNodesRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel2 := Doc().Root.Find(".center-content")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := Doc().Find(".center-content")
|
||||
sel2 = sel.HasNodes(sel2.Nodes...).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestHasSelection(t *testing.T) {
|
||||
sel := Doc().Root.Find("p")
|
||||
sel2 := Doc().Root.Find("small")
|
||||
sel := Doc().Find("p")
|
||||
sel2 := Doc().Find("small")
|
||||
sel = sel.HasSelection(sel2)
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestHasSelectionRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find("p")
|
||||
sel2 := Doc().Root.Find("small")
|
||||
sel := Doc().Find("p")
|
||||
sel2 := Doc().Find("small")
|
||||
sel2 = sel.HasSelection(sel2).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestEnd(t *testing.T) {
|
||||
sel := Doc().Root.Find("p").Has("small").End()
|
||||
sel := Doc().Find("p").Has("small").End()
|
||||
AssertLength(t, sel.Nodes, 4)
|
||||
}
|
||||
|
||||
func TestEndToTop(t *testing.T) {
|
||||
sel := Doc().Root.Find("p").Has("small").End().End().End()
|
||||
sel := Doc().Find("p").Has("small").End().End().End()
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
@@ -9,6 +9,19 @@ func (this *Selection) Each(f func(int, *Selection)) *Selection {
|
||||
return this
|
||||
}
|
||||
|
||||
// EachWithBreak() iterates over a Selection object, executing a function for each
|
||||
// matched element. It is identical to `Each()` except that it is possible to break
|
||||
// out of the loop by returning `false` in the callback function. It returns the
|
||||
// current Selection object.
|
||||
func (this *Selection) EachWithBreak(f func(int, *Selection) bool) *Selection {
|
||||
for i, n := range this.Nodes {
|
||||
if !f(i, newSingleSelection(n, this.document)) {
|
||||
return this
|
||||
}
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
// Map() passes each element in the current matched set through a function,
|
||||
// producing a slice of string holding the returned values.
|
||||
func (this *Selection) Map(f func(int, *Selection) string) (result []string) {
|
||||
|
||||
+19
-4
@@ -1,14 +1,14 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"exp/html"
|
||||
"code.google.com/p/go.net/html"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestEach(t *testing.T) {
|
||||
var cnt int
|
||||
|
||||
sel := Doc().Root.Find(".hero-unit .row-fluid").Each(func(i int, n *Selection) {
|
||||
sel := Doc().Find(".hero-unit .row-fluid").Each(func(i int, n *Selection) {
|
||||
cnt++
|
||||
t.Logf("At index %v, node %v", i, n.Nodes[0].Data)
|
||||
}).Find("a")
|
||||
@@ -19,10 +19,25 @@ func TestEach(t *testing.T) {
|
||||
AssertLength(t, sel.Nodes, 6)
|
||||
}
|
||||
|
||||
func TestEachWithBreak(t *testing.T) {
|
||||
var cnt int
|
||||
|
||||
sel := Doc().Find(".hero-unit .row-fluid").EachWithBreak(func(i int, n *Selection) bool {
|
||||
cnt++
|
||||
t.Logf("At index %v, node %v", i, n.Nodes[0].Data)
|
||||
return false
|
||||
}).Find("a")
|
||||
|
||||
if cnt != 1 {
|
||||
t.Errorf("Expected Each() to call function 1 time, got %v times.", cnt)
|
||||
}
|
||||
AssertLength(t, sel.Nodes, 6)
|
||||
}
|
||||
|
||||
func TestEachEmptySelection(t *testing.T) {
|
||||
var cnt int
|
||||
|
||||
sel := Doc().Root.Find("zzzz")
|
||||
sel := Doc().Find("zzzz")
|
||||
sel.Each(func(i int, n *Selection) {
|
||||
cnt++
|
||||
})
|
||||
@@ -34,7 +49,7 @@ func TestEachEmptySelection(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMap(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
vals := sel.Map(func(i int, s *Selection) string {
|
||||
n := s.Get(0)
|
||||
if n.Type == html.ElementNode {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package goquery
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"exp/html"
|
||||
"code.google.com/p/go.net/html"
|
||||
)
|
||||
|
||||
// Attr() gets the specified attribute's value for the first element in the
|
||||
|
||||
+6
-6
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func TestAttrExists(t *testing.T) {
|
||||
if val, ok := Doc().Root.Find("a").Attr("href"); !ok {
|
||||
if val, ok := Doc().Find("a").Attr("href"); !ok {
|
||||
t.Error("Expected a value for the href attribute.")
|
||||
} else {
|
||||
t.Logf("Href of first anchor: %v.", val)
|
||||
@@ -15,20 +15,20 @@ func TestAttrExists(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAttrNotExist(t *testing.T) {
|
||||
if val, ok := Doc().Root.Find("div.row-fluid").Attr("href"); ok {
|
||||
if val, ok := Doc().Find("div.row-fluid").Attr("href"); ok {
|
||||
t.Errorf("Expected no value for the href attribute, got %v.", val)
|
||||
}
|
||||
}
|
||||
|
||||
func TestText(t *testing.T) {
|
||||
txt := Doc().Root.Find("h1").Text()
|
||||
txt := Doc().Find("h1").Text()
|
||||
if strings.Trim(txt, " \n\r\t") != "Provok.in" {
|
||||
t.Errorf("Expected text to be Provok.in, found %s.", txt)
|
||||
}
|
||||
}
|
||||
|
||||
func TestText2(t *testing.T) {
|
||||
txt := Doc().Root.Find(".hero-unit .container-fluid .row-fluid:nth-child(1)").Text()
|
||||
txt := Doc().Find(".hero-unit .container-fluid .row-fluid:nth-child(1)").Text()
|
||||
if ok, e := regexp.MatchString(`^\s+Provok\.in\s+Prove your point.\s+$`, txt); !ok || e != nil {
|
||||
t.Errorf("Expected text to be Provok.in Prove your point., found %s.", txt)
|
||||
if e != nil {
|
||||
@@ -38,7 +38,7 @@ func TestText2(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestText3(t *testing.T) {
|
||||
txt := Doc().Root.Find(".pvk-gutter").First().Text()
|
||||
txt := Doc().Find(".pvk-gutter").First().Text()
|
||||
// There's an character in there...
|
||||
if ok, e := regexp.MatchString(`^[\s\x{00A0}]+$`, txt); !ok || e != nil {
|
||||
t.Errorf("Expected spaces, found <%v>.", txt)
|
||||
@@ -49,7 +49,7 @@ func TestText3(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestHtml(t *testing.T) {
|
||||
txt, e := Doc().Root.Find("h1").Html()
|
||||
txt, e := Doc().Find("h1").Html()
|
||||
if e != nil {
|
||||
t.Errorf("Error: %s.", e)
|
||||
}
|
||||
|
||||
@@ -2,37 +2,23 @@ package goquery
|
||||
|
||||
import (
|
||||
"code.google.com/p/cascadia"
|
||||
"exp/html"
|
||||
"code.google.com/p/go.net/html"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var rxNeedsContext = `^[\x20\t\r\n\f]*[>+~]|:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\)|)(?:[^-]|$)`
|
||||
var rxClassTrim = regexp.MustCompile("[\t\r\n]")
|
||||
|
||||
// Is() checks the current matched set of elements against a selector and
|
||||
// returns true if at least one of these elements matches.
|
||||
func (this *Selection) Is(selector string) bool {
|
||||
if len(this.Nodes) > 0 {
|
||||
// The selector must be done on the document if it has positional criteria
|
||||
if ok, e := regexp.MatchString(rxNeedsContext, selector); ok {
|
||||
sel := this.document.Root.Find(selector)
|
||||
for _, n := range this.Nodes {
|
||||
if sel.IndexOfNode(n) > -1 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
} else if e != nil {
|
||||
panic(e.Error())
|
||||
|
||||
// Attempt a match with the selector
|
||||
cs := cascadia.MustCompile(selector)
|
||||
if len(this.Nodes) == 1 {
|
||||
return cs.Match(this.Nodes[0])
|
||||
} else {
|
||||
// Attempt a match with the selector
|
||||
cs := cascadia.MustCompile(selector)
|
||||
if len(this.Nodes) == 1 {
|
||||
return cs.Match(this.Nodes[0])
|
||||
} else {
|
||||
return len(cs.Filter(this.Nodes)) > 0
|
||||
}
|
||||
return len(cs.Filter(this.Nodes)) > 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,14 +46,12 @@ func (this *Selection) IsNodes(nodes ...*html.Node) bool {
|
||||
// HasClass() determines whether any of the matched elements are assigned the
|
||||
// given class.
|
||||
func (this *Selection) HasClass(class string) bool {
|
||||
var rx = regexp.MustCompile("[\t\r\n]")
|
||||
|
||||
class = " " + class + " "
|
||||
for _, n := range this.Nodes {
|
||||
// Applies only to element nodes
|
||||
if n.Type == html.ElementNode {
|
||||
if elClass, ok := getAttributeValue("class", n); ok {
|
||||
elClass = rx.ReplaceAllString(" "+elClass+" ", " ")
|
||||
elClass = rxClassTrim.ReplaceAllString(" "+elClass+" ", " ")
|
||||
if strings.Index(elClass, class) > -1 {
|
||||
return true
|
||||
}
|
||||
|
||||
+20
-20
@@ -5,28 +5,28 @@ import (
|
||||
)
|
||||
|
||||
func TestIs(t *testing.T) {
|
||||
sel := Doc().Root.Find(".footer p:nth-child(1)")
|
||||
sel := Doc().Find(".footer p:nth-child(1)")
|
||||
if !sel.Is("p") {
|
||||
t.Error("Expected .footer p:nth-child(1) to be p.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsPositional(t *testing.T) {
|
||||
sel := Doc().Root.Find(".footer p:nth-child(2)")
|
||||
sel := Doc().Find(".footer p:nth-child(2)")
|
||||
if !sel.Is("p:nth-child(2)") {
|
||||
t.Error("Expected .footer p:nth-child(2) to be p:nth-child(2).")
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsPositionalNot(t *testing.T) {
|
||||
sel := Doc().Root.Find(".footer p:nth-child(1)")
|
||||
sel := Doc().Find(".footer p:nth-child(1)")
|
||||
if sel.Is("p:nth-child(2)") {
|
||||
t.Error("Expected .footer p:nth-child(1) NOT to be p:nth-child(2).")
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsFunction(t *testing.T) {
|
||||
ok := Doc().Root.Find("div").IsFunction(func(i int, s *Selection) bool {
|
||||
ok := Doc().Find("div").IsFunction(func(i int, s *Selection) bool {
|
||||
return s.HasClass("container-fluid")
|
||||
})
|
||||
|
||||
@@ -36,7 +36,7 @@ func TestIsFunction(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIsFunctionRollback(t *testing.T) {
|
||||
ok := Doc().Root.Find("div").IsFunction(func(i int, s *Selection) bool {
|
||||
ok := Doc().Find("div").IsFunction(func(i int, s *Selection) bool {
|
||||
return s.HasClass("container-fluid")
|
||||
})
|
||||
|
||||
@@ -46,8 +46,8 @@ func TestIsFunctionRollback(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIsSelection(t *testing.T) {
|
||||
sel := Doc().Root.Find("div")
|
||||
sel2 := Doc().Root.Find(".pvk-gutter")
|
||||
sel := Doc().Find("div")
|
||||
sel2 := Doc().Find(".pvk-gutter")
|
||||
|
||||
if !sel.IsSelection(sel2) {
|
||||
t.Error("Expected some div to have a pvk-gutter class.")
|
||||
@@ -55,8 +55,8 @@ func TestIsSelection(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIsSelectionNot(t *testing.T) {
|
||||
sel := Doc().Root.Find("div")
|
||||
sel2 := Doc().Root.Find("a")
|
||||
sel := Doc().Find("div")
|
||||
sel2 := Doc().Find("a")
|
||||
|
||||
if sel.IsSelection(sel2) {
|
||||
t.Error("Expected some div NOT to be an anchor.")
|
||||
@@ -64,8 +64,8 @@ func TestIsSelectionNot(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIsNodes(t *testing.T) {
|
||||
sel := Doc().Root.Find("div")
|
||||
sel2 := Doc().Root.Find(".footer")
|
||||
sel := Doc().Find("div")
|
||||
sel2 := Doc().Find(".footer")
|
||||
|
||||
if !sel.IsNodes(sel2.Nodes[0]) {
|
||||
t.Error("Expected some div to have a footer class.")
|
||||
@@ -73,44 +73,44 @@ func TestIsNodes(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestHasClass(t *testing.T) {
|
||||
sel := Doc().Root.Find("div")
|
||||
sel := Doc().Find("div")
|
||||
if !sel.HasClass("span12") {
|
||||
t.Error("Expected at least one div to have class span12.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHasClassNone(t *testing.T) {
|
||||
sel := Doc().Root.Find("h2")
|
||||
sel := Doc().Find("h2")
|
||||
if sel.HasClass("toto") {
|
||||
t.Error("Expected h1 to have no class.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHasClassNotFirst(t *testing.T) {
|
||||
sel := Doc().Root.Find(".alert")
|
||||
sel := Doc().Find(".alert")
|
||||
if !sel.HasClass("alert-error") {
|
||||
t.Error("Expected .alert to also have class .alert-error.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDocContains(t *testing.T) {
|
||||
sel := Doc().Root.Find("h1")
|
||||
if !Doc().Root.Contains(sel.Nodes[0]) {
|
||||
sel := Doc().Find("h1")
|
||||
if !Doc().Contains(sel.Nodes[0]) {
|
||||
t.Error("Expected document to contain H1 tag.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSelContains(t *testing.T) {
|
||||
sel := Doc().Root.Find(".row-fluid")
|
||||
sel2 := Doc().Root.Find("a[ng-click]")
|
||||
sel := Doc().Find(".row-fluid")
|
||||
sel2 := Doc().Find("a[ng-click]")
|
||||
if !sel.Contains(sel2.Nodes[0]) {
|
||||
t.Error("Expected .row-fluid to contain a[ng-click] tag.")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSelNotContains(t *testing.T) {
|
||||
sel := Doc().Root.Find("a.link")
|
||||
sel2 := Doc().Root.Find("span")
|
||||
sel := Doc().Find("a.link")
|
||||
sel2 := Doc().Find("span")
|
||||
if sel.Contains(sel2.Nodes[0]) {
|
||||
t.Error("Expected a.link to NOT contain span tag.")
|
||||
}
|
||||
|
||||
Vendored
+855
@@ -0,0 +1,855 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
|
||||
<title>testing - The Go Programming Language</title>
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="/doc/style.css">
|
||||
<script type="text/javascript" src="/doc/godocs.js"></script>
|
||||
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="godoc" href="/opensearch.xml" />
|
||||
|
||||
<script type="text/javascript">
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(["_setAccount", "UA-11222381-2"]);
|
||||
_gaq.push(["_trackPageview"]);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="topbar"><div class="container wide">
|
||||
|
||||
<form method="GET" action="/search">
|
||||
<div id="menu">
|
||||
<a href="/doc/">Documents</a>
|
||||
<a href="/ref/">References</a>
|
||||
<a href="/pkg/">Packages</a>
|
||||
<a href="/project/">The Project</a>
|
||||
<a href="/help/">Help</a>
|
||||
<input type="text" id="search" name="q" class="inactive" value="Search">
|
||||
</div>
|
||||
<div id="heading"><a href="/">The Go Programming Language</a></div>
|
||||
</form>
|
||||
|
||||
</div></div>
|
||||
|
||||
<div id="page" class="wide">
|
||||
|
||||
|
||||
<div id="plusone"><g:plusone size="small" annotation="none"></g:plusone></div>
|
||||
<h1>Package testing</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="nav"></div>
|
||||
|
||||
|
||||
<!--
|
||||
Copyright 2009 The Go Authors. All rights reserved.
|
||||
Use of this source code is governed by a BSD-style
|
||||
license that can be found in the LICENSE file.
|
||||
-->
|
||||
|
||||
|
||||
<div id="short-nav">
|
||||
<dl>
|
||||
<dd><code>import "testing"</code></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dd><a href="#overview" class="overviewLink">Overview</a></dd>
|
||||
<dd><a href="#index">Index</a></dd>
|
||||
|
||||
|
||||
<dd><a href="#subdirectories">Subdirectories</a></dd>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<!-- The package's Name is printed as title by the top-level template -->
|
||||
<div id="overview" class="toggleVisible">
|
||||
<div class="collapsed">
|
||||
<h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
|
||||
</div>
|
||||
<div class="expanded">
|
||||
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
|
||||
<p>
|
||||
Package testing provides support for automated testing of Go packages.
|
||||
It is intended to be used in concert with the “go test” command, which automates
|
||||
execution of any function of the form
|
||||
</p>
|
||||
<pre>func TestXxx(*testing.T)
|
||||
</pre>
|
||||
<p>
|
||||
where Xxx can be any alphanumeric string (but the first letter must not be in
|
||||
[a-z]) and serves to identify the test routine.
|
||||
These TestXxx routines should be declared within the package they are testing.
|
||||
</p>
|
||||
<p>
|
||||
Functions of the form
|
||||
</p>
|
||||
<pre>func BenchmarkXxx(*testing.B)
|
||||
</pre>
|
||||
<p>
|
||||
are considered benchmarks, and are executed by the "go test" command when
|
||||
the -test.bench flag is provided.
|
||||
</p>
|
||||
<p>
|
||||
A sample benchmark function looks like this:
|
||||
</p>
|
||||
<pre>func BenchmarkHello(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
fmt.Sprintf("hello")
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
The benchmark package will vary b.N until the benchmark function lasts
|
||||
long enough to be timed reliably. The output
|
||||
</p>
|
||||
<pre>testing.BenchmarkHello 10000000 282 ns/op
|
||||
</pre>
|
||||
<p>
|
||||
means that the loop ran 10000000 times at a speed of 282 ns per loop.
|
||||
</p>
|
||||
<p>
|
||||
If a benchmark needs some expensive setup before running, the timer
|
||||
may be stopped:
|
||||
</p>
|
||||
<pre>func BenchmarkBigLen(b *testing.B) {
|
||||
b.StopTimer()
|
||||
big := NewBig()
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
big.Len()
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
The package also runs and verifies example code. Example functions may
|
||||
include a concluding comment that begins with "Output:" and is compared with
|
||||
the standard output of the function when the tests are run, as in these
|
||||
examples of an example:
|
||||
</p>
|
||||
<pre>func ExampleHello() {
|
||||
fmt.Println("hello")
|
||||
// Output: hello
|
||||
}
|
||||
|
||||
func ExampleSalutations() {
|
||||
fmt.Println("hello, and")
|
||||
fmt.Println("goodbye")
|
||||
// Output:
|
||||
// hello, and
|
||||
// goodbye
|
||||
}
|
||||
</pre>
|
||||
<p>
|
||||
Example functions without output comments are compiled but not executed.
|
||||
</p>
|
||||
<p>
|
||||
The naming convention to declare examples for a function F, a type T and
|
||||
method M on type T are:
|
||||
</p>
|
||||
<pre>func ExampleF() { ... }
|
||||
func ExampleT() { ... }
|
||||
func ExampleT_M() { ... }
|
||||
</pre>
|
||||
<p>
|
||||
Multiple example functions for a type/function/method may be provided by
|
||||
appending a distinct suffix to the name. The suffix must start with a
|
||||
lower-case letter.
|
||||
</p>
|
||||
<pre>func ExampleF_suffix() { ... }
|
||||
func ExampleT_suffix() { ... }
|
||||
func ExampleT_M_suffix() { ... }
|
||||
</pre>
|
||||
<p>
|
||||
The entire test file is presented as the example when it contains a single
|
||||
example function, at least one other function, type, variable, or constant
|
||||
declaration, and no test or benchmark functions.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<h2 id="index">Index</h2>
|
||||
<!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
|
||||
<div id="manual-nav">
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
<dd><a href="#Main">func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)</a></dd>
|
||||
|
||||
|
||||
<dd><a href="#RunBenchmarks">func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)</a></dd>
|
||||
|
||||
|
||||
<dd><a href="#RunExamples">func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool)</a></dd>
|
||||
|
||||
|
||||
<dd><a href="#RunTests">func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)</a></dd>
|
||||
|
||||
|
||||
<dd><a href="#Short">func Short() bool</a></dd>
|
||||
|
||||
|
||||
|
||||
<dd><a href="#B">type B</a></dd>
|
||||
|
||||
|
||||
|
||||
<dd> <a href="#B.Error">func (c *B) Error(args ...interface{})</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#B.Errorf">func (c *B) Errorf(format string, args ...interface{})</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#B.Fail">func (c *B) Fail()</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#B.FailNow">func (c *B) FailNow()</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#B.Failed">func (c *B) Failed() bool</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#B.Fatal">func (c *B) Fatal(args ...interface{})</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#B.Fatalf">func (c *B) Fatalf(format string, args ...interface{})</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#B.Log">func (c *B) Log(args ...interface{})</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#B.Logf">func (c *B) Logf(format string, args ...interface{})</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#B.ResetTimer">func (b *B) ResetTimer()</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#B.SetBytes">func (b *B) SetBytes(n int64)</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#B.StartTimer">func (b *B) StartTimer()</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#B.StopTimer">func (b *B) StopTimer()</a></dd>
|
||||
|
||||
|
||||
|
||||
<dd><a href="#BenchmarkResult">type BenchmarkResult</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#Benchmark">func Benchmark(f func(b *B)) BenchmarkResult</a></dd>
|
||||
|
||||
|
||||
|
||||
<dd> <a href="#BenchmarkResult.NsPerOp">func (r BenchmarkResult) NsPerOp() int64</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#BenchmarkResult.String">func (r BenchmarkResult) String() string</a></dd>
|
||||
|
||||
|
||||
|
||||
<dd><a href="#InternalBenchmark">type InternalBenchmark</a></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dd><a href="#InternalExample">type InternalExample</a></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dd><a href="#InternalTest">type InternalTest</a></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<dd><a href="#T">type T</a></dd>
|
||||
|
||||
|
||||
|
||||
<dd> <a href="#T.Error">func (c *T) Error(args ...interface{})</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#T.Errorf">func (c *T) Errorf(format string, args ...interface{})</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#T.Fail">func (c *T) Fail()</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#T.FailNow">func (c *T) FailNow()</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#T.Failed">func (c *T) Failed() bool</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#T.Fatal">func (c *T) Fatal(args ...interface{})</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#T.Fatalf">func (c *T) Fatalf(format string, args ...interface{})</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#T.Log">func (c *T) Log(args ...interface{})</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#T.Logf">func (c *T) Logf(format string, args ...interface{})</a></dd>
|
||||
|
||||
|
||||
<dd> <a href="#T.Parallel">func (t *T) Parallel()</a></dd>
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4>Package files</h4>
|
||||
<p>
|
||||
<span style="font-size:90%">
|
||||
|
||||
<a href="/src/pkg/testing/benchmark.go">benchmark.go</a>
|
||||
|
||||
<a href="/src/pkg/testing/example.go">example.go</a>
|
||||
|
||||
<a href="/src/pkg/testing/testing.go">testing.go</a>
|
||||
|
||||
</span>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="Main">func <a href="/src/pkg/testing/testing.go?s=9750:9890#L268">Main</a></h2>
|
||||
<pre>func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)</pre>
|
||||
<p>
|
||||
An internal function but exported because it is cross-package; part of the implementation
|
||||
of the "go test" command.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="RunBenchmarks">func <a href="/src/pkg/testing/benchmark.go?s=5365:5464#L207">RunBenchmarks</a></h2>
|
||||
<pre>func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)</pre>
|
||||
<p>
|
||||
An internal function but exported because it is cross-package; part of the implementation
|
||||
of the "go test" command.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="RunExamples">func <a href="/src/pkg/testing/example.go?s=314:417#L12">RunExamples</a></h2>
|
||||
<pre>func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool)</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="RunTests">func <a href="/src/pkg/testing/testing.go?s=10486:10580#L297">RunTests</a></h2>
|
||||
<pre>func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="Short">func <a href="/src/pkg/testing/testing.go?s=4859:4876#L117">Short</a></h2>
|
||||
<pre>func Short() bool</pre>
|
||||
<p>
|
||||
Short reports whether the -test.short flag is set.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="B">type <a href="/src/pkg/testing/benchmark.go?s=743:872#L17">B</a></h2>
|
||||
<pre>type B struct {
|
||||
N int
|
||||
<span class="comment">// contains filtered or unexported fields</span>
|
||||
}</pre>
|
||||
<p>
|
||||
B is a type passed to Benchmark functions to manage benchmark
|
||||
timing and to specify the number of iterations to run.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.Error">func (*B) <a href="/src/pkg/testing/testing.go?s=8110:8153#L209">Error</a></h3>
|
||||
<pre>func (c *B) Error(args ...interface{})</pre>
|
||||
<p>
|
||||
Error is equivalent to Log() followed by Fail().
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.Errorf">func (*B) <a href="/src/pkg/testing/testing.go?s=8253:8312#L215">Errorf</a></h3>
|
||||
<pre>func (c *B) Errorf(format string, args ...interface{})</pre>
|
||||
<p>
|
||||
Errorf is equivalent to Logf() followed by Fail().
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.Fail">func (*B) <a href="/src/pkg/testing/testing.go?s=6270:6293#L163">Fail</a></h3>
|
||||
<pre>func (c *B) Fail()</pre>
|
||||
<p>
|
||||
Fail marks the function as having failed but continues execution.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.FailNow">func (*B) <a href="/src/pkg/testing/testing.go?s=6548:6574#L170">FailNow</a></h3>
|
||||
<pre>func (c *B) FailNow()</pre>
|
||||
<p>
|
||||
FailNow marks the function as having failed and stops its execution.
|
||||
Execution will continue at the next test or benchmark.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.Failed">func (*B) <a href="/src/pkg/testing/testing.go?s=6366:6396#L166">Failed</a></h3>
|
||||
<pre>func (c *B) Failed() bool</pre>
|
||||
<p>
|
||||
Failed returns whether the function has failed.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.Fatal">func (*B) <a href="/src/pkg/testing/testing.go?s=8420:8463#L221">Fatal</a></h3>
|
||||
<pre>func (c *B) Fatal(args ...interface{})</pre>
|
||||
<p>
|
||||
Fatal is equivalent to Log() followed by FailNow().
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.Fatalf">func (*B) <a href="/src/pkg/testing/testing.go?s=8569:8628#L227">Fatalf</a></h3>
|
||||
<pre>func (c *B) Fatalf(format string, args ...interface{})</pre>
|
||||
<p>
|
||||
Fatalf is equivalent to Logf() followed by FailNow().
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.Log">func (*B) <a href="/src/pkg/testing/testing.go?s=7763:7804#L202">Log</a></h3>
|
||||
<pre>func (c *B) Log(args ...interface{})</pre>
|
||||
<p>
|
||||
Log formats its arguments using default formatting, analogous to Println(),
|
||||
and records the text in the error log.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.Logf">func (*B) <a href="/src/pkg/testing/testing.go?s=7959:8016#L206">Logf</a></h3>
|
||||
<pre>func (c *B) Logf(format string, args ...interface{})</pre>
|
||||
<p>
|
||||
Logf formats its arguments according to the format, analogous to Printf(),
|
||||
and records the text in the error log.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.ResetTimer">func (*B) <a href="/src/pkg/testing/benchmark.go?s=1503:1527#L48">ResetTimer</a></h3>
|
||||
<pre>func (b *B) ResetTimer()</pre>
|
||||
<p>
|
||||
ResetTimer sets the elapsed benchmark time to zero.
|
||||
It does not affect whether the timer is running.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.SetBytes">func (*B) <a href="/src/pkg/testing/benchmark.go?s=1728:1757#L57">SetBytes</a></h3>
|
||||
<pre>func (b *B) SetBytes(n int64)</pre>
|
||||
<p>
|
||||
SetBytes records the number of bytes processed in a single operation.
|
||||
If this is called, the benchmark will report ns/op and MB/s.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.StartTimer">func (*B) <a href="/src/pkg/testing/benchmark.go?s=1047:1071#L29">StartTimer</a></h3>
|
||||
<pre>func (b *B) StartTimer()</pre>
|
||||
<p>
|
||||
StartTimer starts timing a test. This function is called automatically
|
||||
before a benchmark starts, but it can also used to resume timing after
|
||||
a call to StopTimer.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="B.StopTimer">func (*B) <a href="/src/pkg/testing/benchmark.go?s=1288:1311#L39">StopTimer</a></h3>
|
||||
<pre>func (b *B) StopTimer()</pre>
|
||||
<p>
|
||||
StopTimer stops timing a test. This can be used to pause the timer
|
||||
while performing complex initialization that you don't
|
||||
want to measure.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="BenchmarkResult">type <a href="/src/pkg/testing/benchmark.go?s=4206:4391#L165">BenchmarkResult</a></h2>
|
||||
<pre>type BenchmarkResult struct {
|
||||
N int <span class="comment">// The number of iterations.</span>
|
||||
T time.Duration <span class="comment">// The total time taken.</span>
|
||||
Bytes int64 <span class="comment">// Bytes processed in one iteration.</span>
|
||||
}</pre>
|
||||
<p>
|
||||
The results of a benchmark run.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="Benchmark">func <a href="/src/pkg/testing/benchmark.go?s=7545:7589#L275">Benchmark</a></h3>
|
||||
<pre>func Benchmark(f func(b *B)) BenchmarkResult</pre>
|
||||
<p>
|
||||
Benchmark benchmarks a single function. Useful for creating
|
||||
custom benchmarks that do not use the "go test" command.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="BenchmarkResult.NsPerOp">func (BenchmarkResult) <a href="/src/pkg/testing/benchmark.go?s=4393:4433#L171">NsPerOp</a></h3>
|
||||
<pre>func (r BenchmarkResult) NsPerOp() int64</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="BenchmarkResult.String">func (BenchmarkResult) <a href="/src/pkg/testing/benchmark.go?s=4677:4717#L185">String</a></h3>
|
||||
<pre>func (r BenchmarkResult) String() string</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="InternalBenchmark">type <a href="/src/pkg/testing/benchmark.go?s=555:618#L10">InternalBenchmark</a></h2>
|
||||
<pre>type InternalBenchmark struct {
|
||||
Name string
|
||||
F func(b *B)
|
||||
}</pre>
|
||||
<p>
|
||||
An internal type but exported because it is cross-package; part of the implementation
|
||||
of the "go test" command.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="InternalExample">type <a href="/src/pkg/testing/example.go?s=236:312#L6">InternalExample</a></h2>
|
||||
<pre>type InternalExample struct {
|
||||
Name string
|
||||
F func()
|
||||
Output string
|
||||
}</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="InternalTest">type <a href="/src/pkg/testing/testing.go?s=9065:9121#L241">InternalTest</a></h2>
|
||||
<pre>type InternalTest struct {
|
||||
Name string
|
||||
F func(*T)
|
||||
}</pre>
|
||||
<p>
|
||||
An internal type but exported because it is cross-package; part of the implementation
|
||||
of the "go test" command.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="T">type <a href="/src/pkg/testing/testing.go?s=6070:6199#L156">T</a></h2>
|
||||
<pre>type T struct {
|
||||
<span class="comment">// contains filtered or unexported fields</span>
|
||||
}</pre>
|
||||
<p>
|
||||
T is a type passed to Test functions to manage test state and support formatted test logs.
|
||||
Logs are accumulated during execution and dumped to standard error when done.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="T.Error">func (*T) <a href="/src/pkg/testing/testing.go?s=8110:8153#L209">Error</a></h3>
|
||||
<pre>func (c *T) Error(args ...interface{})</pre>
|
||||
<p>
|
||||
Error is equivalent to Log() followed by Fail().
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="T.Errorf">func (*T) <a href="/src/pkg/testing/testing.go?s=8253:8312#L215">Errorf</a></h3>
|
||||
<pre>func (c *T) Errorf(format string, args ...interface{})</pre>
|
||||
<p>
|
||||
Errorf is equivalent to Logf() followed by Fail().
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="T.Fail">func (*T) <a href="/src/pkg/testing/testing.go?s=6270:6293#L163">Fail</a></h3>
|
||||
<pre>func (c *T) Fail()</pre>
|
||||
<p>
|
||||
Fail marks the function as having failed but continues execution.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="T.FailNow">func (*T) <a href="/src/pkg/testing/testing.go?s=6548:6574#L170">FailNow</a></h3>
|
||||
<pre>func (c *T) FailNow()</pre>
|
||||
<p>
|
||||
FailNow marks the function as having failed and stops its execution.
|
||||
Execution will continue at the next test or benchmark.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="T.Failed">func (*T) <a href="/src/pkg/testing/testing.go?s=6366:6396#L166">Failed</a></h3>
|
||||
<pre>func (c *T) Failed() bool</pre>
|
||||
<p>
|
||||
Failed returns whether the function has failed.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="T.Fatal">func (*T) <a href="/src/pkg/testing/testing.go?s=8420:8463#L221">Fatal</a></h3>
|
||||
<pre>func (c *T) Fatal(args ...interface{})</pre>
|
||||
<p>
|
||||
Fatal is equivalent to Log() followed by FailNow().
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="T.Fatalf">func (*T) <a href="/src/pkg/testing/testing.go?s=8569:8628#L227">Fatalf</a></h3>
|
||||
<pre>func (c *T) Fatalf(format string, args ...interface{})</pre>
|
||||
<p>
|
||||
Fatalf is equivalent to Logf() followed by FailNow().
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="T.Log">func (*T) <a href="/src/pkg/testing/testing.go?s=7763:7804#L202">Log</a></h3>
|
||||
<pre>func (c *T) Log(args ...interface{})</pre>
|
||||
<p>
|
||||
Log formats its arguments using default formatting, analogous to Println(),
|
||||
and records the text in the error log.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="T.Logf">func (*T) <a href="/src/pkg/testing/testing.go?s=7959:8016#L206">Logf</a></h3>
|
||||
<pre>func (c *T) Logf(format string, args ...interface{})</pre>
|
||||
<p>
|
||||
Logf formats its arguments according to the format, analogous to Printf(),
|
||||
and records the text in the error log.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="T.Parallel">func (*T) <a href="/src/pkg/testing/testing.go?s=8809:8831#L234">Parallel</a></h3>
|
||||
<pre>func (t *T) Parallel()</pre>
|
||||
<p>
|
||||
Parallel signals that this test is to be run in parallel with (and only with)
|
||||
other parallel tests in this CPU group.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="subdirectories">Subdirectories</h2>
|
||||
|
||||
<table class="dir">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th> </th>
|
||||
<th style="text-align: left; width: auto">Synopsis</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="..">..</a></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="name"><a href="iotest">iotest</a></td>
|
||||
<td> </td>
|
||||
<td style="width: auto">Package iotest implements Readers and Writers useful mainly for testing.</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="name"><a href="quick">quick</a></td>
|
||||
<td> </td>
|
||||
<td style="width: auto">Package quick implements utility functions to help with black box testing.</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Build version go1.0.2.<br>
|
||||
Except as <a href="http://code.google.com/policies.html#restrictions">noted</a>,
|
||||
the content of this page is licensed under the
|
||||
Creative Commons Attribution 3.0 License,
|
||||
and code is licensed under a <a href="/LICENSE">BSD license</a>.<br>
|
||||
<a href="/doc/tos.html">Terms of Service</a> |
|
||||
<a href="http://www.google.com/intl/en/privacy/privacy-policy.html">Privacy Policy</a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;
|
||||
ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";
|
||||
var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
||||
po.src = 'https://apis.google.com/js/plusone.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
||||
})();
|
||||
</script>
|
||||
</html>
|
||||
|
||||
Vendored
+1214
File diff suppressed because it is too large
Load Diff
Vendored
+413
@@ -0,0 +1,413 @@
|
||||
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" >
|
||||
<head><meta http-equiv="X-UA-Compatible" content="IE=8" />
|
||||
|
||||
<meta name="keywords" content="metal, reviews, metalreview, metalreviews, heavy, rock, review, music, blogs, forums, community" />
|
||||
<meta name="description" content="Critical heavy metal album and dvd reviews, written by professional writers. Large community with forums, blogs, photos and commenting system." />
|
||||
|
||||
<title>
|
||||
|
||||
|
||||
Metal Reviews, News, Blogs, Interviews and Community | Metal Review
|
||||
|
||||
|
||||
</title><link rel="stylesheet" type="text/css" href="/Content/Css/reset-fonts-grids.css" /><link rel="stylesheet" type="text/css" href="/Content/Css/base.css" /><link rel="stylesheet" type="text/css" href="/Content/Css/core.css" /><link rel="stylesheet" type="text/css" href="/Content/Css/wt-rotator.css" />
|
||||
<script src="/Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
var _comscore = _comscore || [];
|
||||
_comscore.push({ c1: "2", c2: "9290245" });
|
||||
(function () {
|
||||
var s = document.createElement("script"), el = document.getElementsByTagName("script")[0]; s.async = true;
|
||||
s.src = (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js";
|
||||
el.parentNode.insertBefore(s, el);
|
||||
})();
|
||||
</script>
|
||||
<noscript>
|
||||
<img src="http://b.scorecardresearch.com/p?c1=2&c2=9290245&cv=2.0&cj=1" />
|
||||
</noscript>
|
||||
|
||||
|
||||
<div id="doc2" class="yui-t7">
|
||||
<div id="hd">
|
||||
|
||||
|
||||
<div id="main-logo"><a href="/" title="Home"><img src="/Content/Images/metal-review-logo.png" alt="Metal Review Home" border="0" /></a></div>
|
||||
<div id="leaderboard-banner">
|
||||
|
||||
<script language="javascript" type="text/javascript"><!--
|
||||
document.write('<scr' + 'ipt language="javascript1.1" src="http://adserver.adtechus.com/addyn/3.0/5110/73085/0/225/ADTECH;loc=100;target=_blank;key=key1+key2+key3+key4;grp=[group];misc=' + new Date().getTime() + '"></scri' + 'pt>');
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<a href="http://adserver.adtechus.com/adlink/3.0/5110/73085/0/225/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]" target="_blank">
|
||||
<img src="http://adserver.adtechus.com/adserv/3.0/5110/73085/0/225/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]" border="0" width="728" height="90" />
|
||||
</a>
|
||||
</noscript>
|
||||
</div>
|
||||
<div id="header-menu-container">
|
||||
<div id="header-menu">
|
||||
<a href="/reviews/browse">REVIEWS</a>
|
||||
<a href="http://community2.metalreview.com/blogs/editorials/default.aspx">FEATURES</a>
|
||||
<a href="/artists/browse">ARTISTS</a>
|
||||
<a href="/reviews/pipeline">PIPELINE</a>
|
||||
<a href="http://community2.metalreview.com/forums">FORUMS</a>
|
||||
<a href="http://community2.metalreview.com/blogs/">BLOGS</a>
|
||||
<a href="/aboutus">ABOUT US</a>
|
||||
</div>
|
||||
|
||||
<div id="sign-in"><a href="https://metalreview.com/account/signin">SIGN IN</a> | <a href="/account/register">JOIN US</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd">
|
||||
|
||||
<div id="yui-main">
|
||||
<div class="yui-b">
|
||||
<div class="yui-g">
|
||||
<div class="yui-u first">
|
||||
|
||||
|
||||
|
||||
<script src="/Scripts/jquery.wt-rotator.min.js" type="text/javascript"></script>
|
||||
<script src="/Scripts/jquery.wt-rotator-initialize.js" type="text/javascript"></script>
|
||||
<div id="review-showcase-wrapper">
|
||||
<h2 id="showcase-heading">Reviews</h2>
|
||||
<div id="review-showcase">
|
||||
<div class="container">
|
||||
<div class="wt-rotator">
|
||||
<a href="#"></a>
|
||||
<div class="desc">
|
||||
</div>
|
||||
<div class="preloader">
|
||||
</div>
|
||||
<div class="c-panel">
|
||||
<div class="buttons">
|
||||
<div class="prev-btn">
|
||||
</div>
|
||||
<div class="play-btn">
|
||||
</div>
|
||||
<div class="next-btn">
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumbnails">
|
||||
<ul>
|
||||
|
||||
<li><a href="artist.photo?mrx=4641" title="Serpentine Path - Serpentine Path"></a><a href="/reviews/6844/serpentine-path-serpentine-path"></a>
|
||||
<p style="top: 130px; left: 22px; width: 305px; height:60px;">
|
||||
<img class="rotator-cover-art" src="album.cover?art=6844" alt='Serpentine Path - Serpentine Path' title='Serpentine Path - Serpentine Path' />
|
||||
<span class="title"><strong>Serpentine Path</strong></span><br />
|
||||
Serpentine Path<br />
|
||||
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><a href="artist.photo?mrx=4635" title="Hunter's Ground - No God But the Wild"></a><a href="/reviews/6830/hunters-ground-no-god-but-the-wild"></a>
|
||||
<p style="top: 130px; left: 22px; width: 305px; height:60px;">
|
||||
<img class="rotator-cover-art" src="album.cover?art=6830" alt='Hunter's Ground - No God But the Wild' title='Hunter's Ground - No God But the Wild' />
|
||||
<span class="title"><strong>Hunter's Ground</strong></span><br />
|
||||
No God But the Wild<br />
|
||||
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><a href="artist.photo?mrx=1035" title="Blut Aus Nord - 777 - Cosmosophy"></a><a href="/reviews/6829/blut-aus-nord-777---cosmosophy"></a>
|
||||
<p style="top: 130px; left: 22px; width: 305px; height:60px;">
|
||||
<img class="rotator-cover-art" src="album.cover?art=6829" alt='Blut Aus Nord - 777 - Cosmosophy' title='Blut Aus Nord - 777 - Cosmosophy' />
|
||||
<span class="title"><strong>Blut Aus Nord</strong></span><br />
|
||||
777 - Cosmosophy<br />
|
||||
<a href="/tags/10/black"><span class="tag">Black</span></a>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><a href="artist.photo?mrx=1217" title="Ufomammut - Oro: Opus Alter"></a><a href="/reviews/6835/ufomammut-oro--opus-alter"></a>
|
||||
<p style="top: 130px; left: 22px; width: 305px; height:60px;">
|
||||
<img class="rotator-cover-art" src="album.cover?art=6835" alt='Ufomammut - Oro: Opus Alter' title='Ufomammut - Oro: Opus Alter' />
|
||||
<span class="title"><strong>Ufomammut</strong></span><br />
|
||||
Oro: Opus Alter<br />
|
||||
<a href="/tags/2/doom"><span class="tag">Doom</span></a>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><a href="artist.photo?mrx=4590" title="Resurgency - False Enlightenment"></a><a href="/reviews/6746/resurgency-false-enlightenment"></a>
|
||||
<p style="top: 130px; left: 22px; width: 305px; height:60px;">
|
||||
<img class="rotator-cover-art" src="album.cover?art=6746" alt='Resurgency - False Enlightenment' title='Resurgency - False Enlightenment' />
|
||||
<span class="title"><strong>Resurgency</strong></span><br />
|
||||
False Enlightenment<br />
|
||||
<a href="/tags/1/death"><span class="tag">Death</span></a>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><a href="artist.photo?mrx=1360" title="Morgoth - Cursed to Live"></a><a href="/reviews/6800/morgoth-cursed-to-live"></a>
|
||||
<p style="top: 130px; left: 22px; width: 305px; height:60px;">
|
||||
<img class="rotator-cover-art" src="album.cover?art=6800" alt='Morgoth - Cursed to Live' title='Morgoth - Cursed to Live' />
|
||||
<span class="title"><strong>Morgoth</strong></span><br />
|
||||
Cursed to Live<br />
|
||||
<a href="/tags/1/death"><span class="tag">Death</span></a><a href="/tags/31/live"><span class="tag">Live</span></a>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><a href="artist.photo?mrx=3879" title="Krallice - Years Past Matter"></a><a href="/reviews/6853/krallice-years-past-matter"></a>
|
||||
<p style="top: 130px; left: 22px; width: 305px; height:60px;">
|
||||
<img class="rotator-cover-art" src="album.cover?art=6853" alt='Krallice - Years Past Matter' title='Krallice - Years Past Matter' />
|
||||
<span class="title"><strong>Krallice</strong></span><br />
|
||||
Years Past Matter<br />
|
||||
<a href="/tags/10/black"><span class="tag">Black</span></a>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><a href="artist.photo?mrx=4243" title="Murder Construct - Results"></a><a href="/reviews/6782/murder-construct-results"></a>
|
||||
<p style="top: 130px; left: 22px; width: 305px; height:60px;">
|
||||
<img class="rotator-cover-art" src="album.cover?art=6782" alt='Murder Construct - Results' title='Murder Construct - Results' />
|
||||
<span class="title"><strong>Murder Construct</strong></span><br />
|
||||
Results<br />
|
||||
<a href="/tags/13/grindcore"><span class="tag">Grindcore</span></a>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><a href="artist.photo?mrx=251" title="Grave - Endless Procession of Souls"></a><a href="/reviews/6834/grave-endless-procession-of-souls"></a>
|
||||
<p style="top: 130px; left: 22px; width: 305px; height:60px;">
|
||||
<img class="rotator-cover-art" src="album.cover?art=6834" alt='Grave - Endless Procession of Souls' title='Grave - Endless Procession of Souls' />
|
||||
<span class="title"><strong>Grave</strong></span><br />
|
||||
Endless Procession of Souls<br />
|
||||
<a href="/tags/1/death"><span class="tag">Death</span></a>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><a href="artist.photo?mrx=3508" title="Master - The New Elite"></a><a href="/reviews/6774/master-the-new-elite"></a>
|
||||
<p style="top: 130px; left: 22px; width: 305px; height:60px;">
|
||||
<img class="rotator-cover-art" src="album.cover?art=6774" alt='Master - The New Elite' title='Master - The New Elite' />
|
||||
<span class="title"><strong>Master</strong></span><br />
|
||||
The New Elite<br />
|
||||
<a href="/tags/1/death"><span class="tag">Death</span></a>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="showcase-all-artist-albums">
|
||||
<a href="/reviews/6844/serpentine-path-serpentine-path"><img src="album.cover?art=6844" alt="Serpentine Path - Serpentine Path" /></a><a href="/reviews/6830/hunters-ground-no-god-but-the-wild"><img src="album.cover?art=6830" alt="Hunter's Ground - No God But the Wild" /></a><a href="/reviews/6829/blut-aus-nord-777---cosmosophy"><img src="album.cover?art=6829" alt="Blut Aus Nord - 777 - Cosmosophy" /></a><a href="/reviews/6835/ufomammut-oro--opus-alter"><img src="album.cover?art=6835" alt="Ufomammut - Oro: Opus Alter" /></a><a href="/reviews/6746/resurgency-false-enlightenment"><img src="album.cover?art=6746" alt="Resurgency - False Enlightenment" /></a><a href="/reviews/6800/morgoth-cursed-to-live"><img src="album.cover?art=6800" alt="Morgoth - Cursed to Live" /></a><a href="/reviews/6853/krallice-years-past-matter"><img src="album.cover?art=6853" alt="Krallice - Years Past Matter" /></a><a href="/reviews/6782/murder-construct-results"><img src="album.cover?art=6782" alt="Murder Construct - Results" /></a><a href="/reviews/6834/grave-endless-procession-of-souls"><img src="album.cover?art=6834" alt="Grave - Endless Procession of Souls" /></a><a href="/reviews/6774/master-the-new-elite"><img src="album.cover?art=6774" alt="Master - The New Elite" /></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui-u">
|
||||
|
||||
|
||||
|
||||
<div id="feature-feed">
|
||||
<h2>Features</h2>
|
||||
<div class="feature-feed-line"><a href="http://community2.metalreview.com/blogs/editorials/archive/2012/08/15/corsair-interview.aspx"><span class="feature-link"><strong>Release The SkyKrakken: Corsair Interview</strong></span></a><br /><span class="publish-date">8/15/2012 by JW</span><img align="left" src="http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.21.25/4TMR3E1CWERK.jpg" alt="JW's Avatar" width="36px" height="40px" border="0" /></div>
|
||||
<div class="feature-feed-line"><a href="http://community2.metalreview.com/blogs/editorials/archive/2012/08/09/riffology-kreative-evolution-part-iii.aspx"><span class="feature-link"><strong>Riffology: Kreative Evolution, Part III</strong></span></a><br /><span class="publish-date">8/9/2012 by Achilles</span><img align="left" src="http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.21.44/4THUGH622I68.jpg" alt="Achilles's Avatar" width="40px" height="39px" border="0" /></div>
|
||||
<div class="feature-feed-line"><a href="http://community2.metalreview.com/blogs/editorials/archive/2012/08/02/reverend-s-bazaar-don-t-trend-on-me.aspx"><span class="feature-link"><strong>Reverend's Bazaar - Don't Trend On Me </strong></span></a><br /><span class="publish-date">8/2/2012 by Reverend Campbell</span><img align="left" src="http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.21.18/4TM06FD0ND4G.png" alt="Reverend Campbell's Avatar" width="34px" height="40px" border="0" /></div>
|
||||
<div class="feature-feed-line"><a href="http://community2.metalreview.com/blogs/editorials/archive/2012/08/01/grand-theft-metal-three-for-free.aspx"><span class="feature-link"><strong>Grand Theft Metal - Free Four All </strong></span></a><br /><span class="publish-date">8/2/2012 by Dave</span><img align="left" src="http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.22.16/4TKJCJQ00VFO.jpg" alt="Dave's Avatar" width="33px" height="40px" border="0" /></div>
|
||||
<div class="feature-feed-line"><a href="http://community2.metalreview.com/blogs/editorials/archive/2012/07/29/monday-with-moonspell-the-interview.aspx"><span class="feature-link"><strong>A Monday with Moonspell: The Interview</strong></span></a><br /><span class="publish-date">7/29/2012 by raetamacue</span><img align="left" src="http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.71.26/4TLIHKLUSXF4.jpg" alt="raetamacue's Avatar" width="37px" height="40px" border="0" /></div>
|
||||
<div class="feature-feed-line"><a href="http://community2.metalreview.com/blogs/editorials/archive/2012/07/26/riffology-kreative-evolution-part-ii.aspx"><span class="feature-link"><strong>Riffology: Kreative Evolution Part II</strong></span></a><br /><span class="publish-date">7/26/2012 by Achilles</span><img align="left" src="http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.21.44/4THUGH622I68.jpg" alt="Achilles's Avatar" width="40px" height="39px" border="0" /></div>
|
||||
<div class="feature-feed-line"><a href="http://community2.metalreview.com/blogs/editorials/archive/2012/07/24/shadow-kingdom-records-giveaway.aspx"><span class="feature-link"><strong>WINNERS ANNOUNCED -- Shadow Kingdom Records Give...</strong></span></a><br /><span class="publish-date">7/24/2012 by Metal Review</span><img align="left" src="http://community2.metalreview.com/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.59.06/4TFD2N58B7BS.png" alt="Metal Review's Avatar" width="34px" height="40px" border="0" /></div>
|
||||
|
||||
<br />
|
||||
<a href="http://community2.metalreview.com/blogs/editorials/default.aspx"><strong>More Editorials</strong></a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui-b">
|
||||
|
||||
|
||||
|
||||
<script src="/Scripts/jquery.cycle.all.min.js" type="text/javascript"></script>
|
||||
<div id="slider-next-button"><img id="slider-next" src="/Content/Images/Backgrounds/rotator-next-button.png" alt="Goto Next Group" title="Goto Next Group" /></div>
|
||||
<div id="slider-back-button"><img id="slider-back" src="/Content/Images/Backgrounds/rotator-back-button.png" alt="Goto Previous Group" title="Goto Previous Group" /></div>
|
||||
<div id="latest-reviews-slider">
|
||||
<div class="slider-row">
|
||||
<div class="slider-item"><a href="/reviews/6795/midnight-complete-and-total-hell"><img src="album.cover?art=6795" alt="Midnight Complete and Total Hell" /><br /><strong>Midnight</strong><br /><em>Complete and Total Hell</em></a><div class="score">8.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6842/over-your-threshold-facticity"><img src="album.cover?art=6842" alt="Over Your Threshold Facticity" /><br /><strong>Over Your Threshold</strong><br /><em>Facticity</em></a><div class="score">6.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6813/nuclear-death-terror-chaos-reigns"><img src="album.cover?art=6813" alt="Nuclear Death Terror Chaos Reigns" /><br /><strong>Nuclear Death Terror</strong><br /><em>Chaos Reigns</em></a><div class="score">7.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6811/evoken-atra-mors"><img src="album.cover?art=6811" alt="Evoken Atra Mors" /><br /><strong>Evoken</strong><br /><em>Atra Mors</em></a><div class="score">9.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6807/blacklodge-machination"><img src="album.cover?art=6807" alt="Blacklodge MachinatioN" /><br /><strong>Blacklodge</strong><br /><em>MachinatioN</em></a><div class="score">5.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6832/prototype-catalyst"><img src="album.cover?art=6832" alt="Prototype Catalyst" /><br /><strong>Prototype</strong><br /><em>Catalyst</em></a><div class="score">8.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6822/hypnosia-horror-infernal"><img src="album.cover?art=6822" alt="Hypnosia Horror Infernal" /><br /><strong>Hypnosia</strong><br /><em>Horror Infernal</em></a><div class="score">7.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6787/om-advaitic-songs"><img src="album.cover?art=6787" alt="OM Advaitic Songs" /><br /><strong>OM</strong><br /><em>Advaitic Songs</em></a><div class="score">8.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6765/afgrund-the-age-of-dumb"><img src="album.cover?art=6765" alt="Afgrund The Age Of Dumb" /><br /><strong>Afgrund</strong><br /><em>The Age Of Dumb</em></a><div class="score">8.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6773/binah-hallucinating-in-resurrecture"><img src="album.cover?art=6773" alt="Binah Hallucinating in Resurrecture" /><br /><strong>Binah</strong><br /><em>Hallucinating in Resurrecture</em></a><div class="score">8.5</div></div>
|
||||
</div>
|
||||
<div class="slider-row">
|
||||
<div class="slider-item"><a href="/reviews/6802/deiphago-satan-alpha-omega"><img src="album.cover?art=6802" alt="Deiphago Satan Alpha Omega" /><br /><strong>Deiphago</strong><br /><em>Satan Alpha Omega</em></a><div class="score">8.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6719/conan-monnos"><img src="album.cover?art=6719" alt="Conan Monnos" /><br /><strong>Conan</strong><br /><em>Monnos</em></a><div class="score">8.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6702/alaric-alaric-atriarch---split-lp"><img src="album.cover?art=6702" alt="Alaric Alaric/Atriarch - Split LP" /><br /><strong>Alaric</strong><br /><em>Alaric/Atriarch - Split LP</em></a><div class="score">8.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6780/coven-worship-new-gods-(reissue)"><img src="album.cover?art=6780" alt="Coven Worship New Gods (Reissue)" /><br /><strong>Coven</strong><br /><em>Worship New Gods (Reissue)</em></a><div class="score">5.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6831/the-foreshadowing-second-world"><img src="album.cover?art=6831" alt="The Foreshadowing Second World" /><br /><strong>The Foreshadowing</strong><br /><em>Second World</em></a><div class="score">5.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6815/nether-regions-into-the-breach"><img src="album.cover?art=6815" alt="Nether Regions Into The Breach" /><br /><strong>Nether Regions</strong><br /><em>Into The Breach</em></a><div class="score">7.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6824/agalloch-faustian-echoes"><img src="album.cover?art=6824" alt="Agalloch Faustian Echoes" /><br /><strong>Agalloch</strong><br /><em>Faustian Echoes</em></a><div class="score">9.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6805/a-forest-of-stars-a-shadowplay-for-yesterdays"><img src="album.cover?art=6805" alt="A Forest Of Stars A Shadowplay For Yesterdays" /><br /><strong>A Forest Of Stars</strong><br /><em>A Shadowplay For Yesterdays</em></a><div class="score">9.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6763/de-profundis-the-emptiness-within"><img src="album.cover?art=6763" alt="De Profundis The Emptiness Within" /><br /><strong>De Profundis</strong><br /><em>The Emptiness Within</em></a><div class="score">7.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6826/ozzy-osbourne-speak-of-the-devil"><img src="album.cover?art=6826" alt="Ozzy Osbourne Speak of the Devil" /><br /><strong>Ozzy Osbourne</strong><br /><em>Speak of the Devil</em></a><div class="score">7.5</div></div>
|
||||
</div>
|
||||
<div class="slider-row">
|
||||
<div class="slider-item"><a href="/reviews/6825/testament-dark-roots-of-earth"><img src="album.cover?art=6825" alt="Testament Dark Roots of Earth" /><br /><strong>Testament</strong><br /><em>Dark Roots of Earth</em></a><div class="score">8.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6796/eagle-twin-the-feather-tipped-the-serpents-scale"><img src="album.cover?art=6796" alt="Eagle Twin The Feather Tipped The Serpent's Scale" /><br /><strong>Eagle Twin</strong><br /><em>The Feather Tipped The Serpent's Scale</em></a><div class="score">8.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6609/king-forged-by-satans-doctrine"><img src="album.cover?art=6609" alt="King Forged by Satan's Doctrine" /><br /><strong>King</strong><br /><em>Forged by Satan's Doctrine</em></a><div class="score">5.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6798/khors-wisdom-of-centuries"><img src="album.cover?art=6798" alt="Khors Wisdom of Centuries" /><br /><strong>Khors</strong><br /><em>Wisdom of Centuries</em></a><div class="score">8.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6776/samothrace-reverence-to-stone"><img src="album.cover?art=6776" alt="Samothrace Reverence To Stone" /><br /><strong>Samothrace</strong><br /><em>Reverence To Stone</em></a><div class="score">8.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6784/horseback-on-the-eclipse"><img src="album.cover?art=6784" alt="Horseback On the Eclipse" /><br /><strong>Horseback</strong><br /><em>On the Eclipse</em></a><div class="score">8.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6690/incoming-cerebral-overdrive-le-stelle--a-voyage-adrift"><img src="album.cover?art=6690" alt="Incoming Cerebral Overdrive Le Stelle: A Voyage Adrift" /><br /><strong>Incoming Cerebral Overdrive</strong><br /><em>Le Stelle: A Voyage Adrift</em></a><div class="score">7.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6658/struck-by-lightning-true-predation"><img src="album.cover?art=6658" alt="Struck By Lightning True Predation" /><br /><strong>Struck By Lightning</strong><br /><em>True Predation</em></a><div class="score">7.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6772/offending-age-of-perversion"><img src="album.cover?art=6772" alt="Offending Age of Perversion" /><br /><strong>Offending</strong><br /><em>Age of Perversion</em></a><div class="score">7.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6804/king-of-asgard----to-north"><img src="album.cover?art=6804" alt="King Of Asgard ...to North" /><br /><strong>King Of Asgard</strong><br /><em>...to North</em></a><div class="score">7.5</div></div>
|
||||
</div>
|
||||
<div class="slider-row">
|
||||
<div class="slider-item"><a href="/reviews/6783/burning-love-rotten-thing-to-say"><img src="album.cover?art=6783" alt="Burning Love Rotten Thing to Say" /><br /><strong>Burning Love</strong><br /><em>Rotten Thing to Say</em></a><div class="score">7.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6770/high-on-fire-the-art-of-self-defense-(reissue)"><img src="album.cover?art=6770" alt="High On Fire The Art Of Self Defense (Reissue)" /><br /><strong>High On Fire</strong><br /><em>The Art Of Self Defense (Reissue)</em></a><div class="score">7.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6660/horseback-half-blood"><img src="album.cover?art=6660" alt="Horseback Half Blood" /><br /><strong>Horseback</strong><br /><em>Half Blood</em></a><div class="score">6.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6732/aldebaran-embracing-the-lightless-depths"><img src="album.cover?art=6732" alt="Aldebaran Embracing the Lightless Depths" /><br /><strong>Aldebaran</strong><br /><em>Embracing the Lightless Depths</em></a><div class="score">8.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6778/tank-war-nation"><img src="album.cover?art=6778" alt="Tank War Nation" /><br /><strong>Tank</strong><br /><em>War Nation</em></a><div class="score">6.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6793/satanic-bloodspraying-at-the-mercy-of-satan"><img src="album.cover?art=6793" alt="Satanic Bloodspraying At the Mercy of Satan" /><br /><strong>Satanic Bloodspraying</strong><br /><em>At the Mercy of Satan</em></a><div class="score">8.5</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6791/from-ashes-rise-rejoice-the-end---rage-of-sanity"><img src="album.cover?art=6791" alt="From Ashes Rise Rejoice The End / Rage Of Sanity" /><br /><strong>From Ashes Rise</strong><br /><em>Rejoice The End / Rage Of Sanity</em></a><div class="score">8.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6743/ereb-altor-gastrike"><img src="album.cover?art=6743" alt="Ereb Altor Gastrike" /><br /><strong>Ereb Altor</strong><br /><em>Gastrike</em></a><div class="score">8.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6794/catheter-southwest-doom-violence"><img src="album.cover?art=6794" alt="Catheter Southwest Doom Violence" /><br /><strong>Catheter</strong><br /><em>Southwest Doom Violence</em></a><div class="score">7.0</div></div>
|
||||
<div class="slider-item"><a href="/reviews/6759/power-theory-an-axe-to-grind"><img src="album.cover?art=6759" alt="Power Theory An Axe to Grind" /><br /><strong>Power Theory</strong><br /><em>An Axe to Grind</em></a><div class="score">6.0</div></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('#latest-reviews-slider').cycle({
|
||||
fx: 'scrollRight',
|
||||
speed: 'fast',
|
||||
timeout: 0,
|
||||
next: '#slider-next-button',
|
||||
prev: '#slider-back-button'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="homepage-mid-horizontal-zone">
|
||||
<script language="javascript" type="text/javascript" src="http://metalreview.com/bannermgr/abm.aspx?z=1"></script>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="news-feed">
|
||||
<h2>News</h2><div class="news-feed-line"><a href="http://www.bravewords.com/news/190057" target="_blank"><span class="news-link"><strong><span class="new-news">NEW</span> CENTURIAN To Release Contra Rationem Album This Winter</strong></span></a><br /><span class="publish-date">9/12/2012</span></div><br />
|
||||
<div class="news-feed-line"><a href="http://www.bravewords.com/news/190056" target="_blank"><span class="news-link"><strong><span class="new-news">NEW</span> Southwest Terror Fest 2012 - Lineup Changes Announced</strong></span></a><br /><span class="publish-date">9/12/2012</span></div><br />
|
||||
<div class="news-feed-line"><a href="http://www.bravewords.com/news/190055" target="_blank"><span class="news-link"><strong><span class="new-news">NEW</span> ROB ZOMBIE Premiers The Lords Of Salem At TIFF; Q&A Video Posted</strong></span></a><br /><span class="publish-date">9/12/2012</span></div><br />
|
||||
<div class="news-feed-line"><a href="http://www.bravewords.com/news/190054" target="_blank"><span class="news-link"><strong><span class="new-news">NEW</span> THIN LIZZY Keyboardist Darren Wharton's DARE - Calm Before The Storm 2 Album Details Revealed</strong></span></a><br /><span class="publish-date">9/12/2012</span></div><br />
|
||||
<div class="news-feed-line"><a href="http://www.bravewords.com/news/190053" target="_blank"><span class="news-link"><strong><span class="new-news">NEW</span> Japan's LIV MOON To Release Fourth Album; Features Past/Present Members Of EUROPE, ANGRA, HAMMERFALL</strong></span></a><br /><span class="publish-date">9/12/2012</span></div><br />
|
||||
<div class="news-feed-line"><a href="http://www.bravewords.com/news/190052" target="_blank"><span class="news-link"><strong><span class="new-news">NEW</span> SLASH - Sydney Show To Premier This Friday, Free And In HD; Trailer Posted</strong></span></a><br /><span class="publish-date">9/12/2012</span></div><br />
|
||||
<div class="news-feed-line"><a href="http://www.bravewords.com/news/190051" target="_blank"><span class="news-link"><strong><span class="new-news">NEW</span> KHAØS - New Band Featuring Members Of OUTLOUD, TRIBAL, JORN And ELIS To Release New EP In October; Teaser Posted </strong></span></a><br /><span class="publish-date">9/12/2012</span></div><br />
|
||||
<div class="news-feed-line"><a href="http://www.bravewords.com/news/190050" target="_blank"><span class="news-link"><strong><span class="new-news">NEW</span> RECKLESS LOVE Confirm Guests For London Residency Shows In October</strong></span></a><br /><span class="publish-date">9/12/2012</span></div><br />
|
||||
<div class="news-feed-line"><a href="http://www.bravewords.com/news/190049" target="_blank"><span class="news-link"><strong>NASHVILLE PUSSY Add Dates In France, Sweden To European Tour Schedule; Bassist Karen Cuda Sidelined With Back Injury </strong></span></a><br /><span class="publish-date">9/12/2012</span></div><br />
|
||||
<div class="news-feed-line"><a href="http://www.bravewords.com/news/190048" target="_blank"><span class="news-link"><strong>CALIBAN Post Behind-The-Scenes Tour Footage</strong></span></a><br /><span class="publish-date">9/12/2012</span></div><br />
|
||||
<div class="news-feed-line"><a href="http://www.bravewords.com/news/190047" target="_blank"><span class="news-link"><strong>Ex-MERCYFUL FATE Drummer Kim Ruzz Forms New Band METALRUZZ</strong></span></a><br /><span class="publish-date">9/12/2012</span></div><br />
|
||||
<div class="news-feed-line"><a href="http://www.bravewords.com/news/190046" target="_blank"><span class="news-link"><strong>GRAVE Mainman On Endless Procession Of Souls - "These Are The Most ‘Song-Oriented’ Tracks We’ve Done In A Long Time"</strong></span></a><br /><span class="publish-date">9/12/2012</span></div><br />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="lashes-feed">
|
||||
<h2>Lashes</h2>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6855/katatonia-dead-end-kings#81760"><span class="new-lash">NEW</span> <span class="lashes-link"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class="publish-date">45 minutes ago by Chaosjunkie</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6855/katatonia-dead-end-kings#81759"><span class="lashes-link"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class="publish-date">1 hour ago by Harry Dick Rotten</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6746/resurgency-false-enlightenment#81758"><span class="lashes-link"><strong>Resurgency - False Enlightenment</strong></span></a><br /><span class="publish-date">3 hours ago by Anonymous</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/4095/witchcraft-the-alchemist#81757"><span class="lashes-link"><strong>Witchcraft - The Alchemist</strong></span></a><br /><span class="publish-date">5 hours ago by Luke_22</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6855/katatonia-dead-end-kings#81756"><span class="lashes-link"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class="publish-date">9 hours ago by chaosjunkie</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6855/katatonia-dead-end-kings#81755"><span class="lashes-link"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class="publish-date">10 hours ago by Compeller</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6827/manetheren-time#81754"><span class="lashes-link"><strong>Manetheren - Time</strong></span></a><br /><span class="publish-date">10 hours ago by xpmule</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6835/ufomammut-oro--opus-alter#81753"><span class="lashes-link"><strong>Ufomammut - Oro: Opus Alter</strong></span></a><br /><span class="publish-date">16 hours ago by Anonymous</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6835/ufomammut-oro--opus-alter#81752"><span class="lashes-link"><strong>Ufomammut - Oro: Opus Alter</strong></span></a><br /><span class="publish-date">17 hours ago by Harry Dick Rotten</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6855/katatonia-dead-end-kings#81751"><span class="lashes-link"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class="publish-date">yesterday by Chaosjunkie</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6855/katatonia-dead-end-kings#81750"><span class="lashes-link"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class="publish-date">yesterday by Anonymous</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6855/katatonia-dead-end-kings#81749"><span class="lashes-link"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class="publish-date">yesterday by Anonymous</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6855/katatonia-dead-end-kings#81748"><span class="lashes-link"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class="publish-date">yesterday by Anonymous</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6855/katatonia-dead-end-kings#81747"><span class="lashes-link"><strong>Katatonia - Dead End Kings</strong></span></a><br /><span class="publish-date">yesterday by frantic</span></div>
|
||||
<div class="lashes-feed-line"><a href="/reviews/6829/blut-aus-nord-777---cosmosophy#81746"><span class="lashes-link"><strong>Blut Aus Nord - 777 - Cosmosophy</strong></span></a><br /><span class="publish-date">yesterday by Dimensional Bleedthrough</span></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="ft">
|
||||
|
||||
|
||||
<div id="template-footer">
|
||||
<div class="left-column">
|
||||
<ul>
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/reviews/browse">Reviews</a></li>
|
||||
<li><a href="/tags">Genre Tags</a></li>
|
||||
<li><a href="http://community2.metalreview.com/blogs/editorials/default.aspx">Features</a></li>
|
||||
<li><a href="/artists/browse">Artists</a></li>
|
||||
<li><a href="/reviews/pipeline">Pipeline</a></li>
|
||||
<li><a href="http://community2.metalreview.com/forums">Forums</a></li>
|
||||
<li><a href="/aboutus">About Us</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="middle-column">
|
||||
<ul>
|
||||
<li><a href="/aboutus/disclaimer">Disclaimer</a></li>
|
||||
<li><a href="/aboutus/privacypolicy">Privacy Policy</a></li>
|
||||
<li><a href="/aboutus/advertising">Advertising</a></li>
|
||||
<li><a href="http://community2.metalreview.com/blogs/eminor/archive/2008/10/27/write-for-metal-review.aspx">Write For Us</a></li>
|
||||
<li><a href="/contactus">Contact Us</a></li>
|
||||
<li><a href="/contactus">Digital Promos</a></li>
|
||||
<li><a href="/contactus">Mailing Address</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="right-column">
|
||||
<ul>
|
||||
<li><a href="http://feeds.feedburner.com/metalreviews">Reviews RSS Feed</a></li>
|
||||
<li><a href="http://twitter.com/metalreview">Twitter</a></li>
|
||||
<li><a href="http://www.myspace.com/metalreviewdotcom">MySpace</a></li>
|
||||
<li><a href="http://www.last.fm/group/MetalReview.com">Last.fm</a></li>
|
||||
<li><a href="http://www.facebook.com/pages/MetalReviewcom/48371319443">Facebook</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="square-ad">
|
||||
|
||||
|
||||
<!--JavaScript Tag // Tag for network 5110: Fixion Media // Website: Metalreview // Page: ROS // Placement: ROS-Middle-300 x 250 (1127996) // created at: Oct 19, 2009 6:48:27 PM-->
|
||||
<script type="text/javascript" language="javascript"><!--
|
||||
document.write('<scr' + 'ipt language="javascript1.1" src="http://adserver.adtechus.com/addyn/3.0/5110/1127996/0/170/ADTECH;loc=100;target=_blank;key=key1+key2+key3+key4;grp=[group];misc=' + new Date().getTime() + '"></scri' + 'pt>');
|
||||
//-->
|
||||
</script><noscript><a href="http://adserver.adtechus.com/adlink/3.0/5110/1127996/0/170/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]" target="_blank"><img src="http://adserver.adtechus.com/adserv/3.0/5110/1127996/0/170/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]" border="0" width="300" height="250"></a></noscript>
|
||||
<!-- End of JavaScript Tag -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var pageTracker = _gat._getTracker("UA-3455310-1");
|
||||
pageTracker._initData();
|
||||
pageTracker._trackPageview();
|
||||
</script>
|
||||
|
||||
<!--JavaScript Tag // Tag for network 5110: Fixion Media // Website: Metalreview // Page: BACKGROUND ADS // Placement: BACKGROUND ADS-Top-1 x 1 (2186116) // created at: Aug 18, 2011 7:20:38 PM-->
|
||||
<script language="javascript"><!--
|
||||
document.write('<scr' + 'ipt language="javascript1.1" src="http://adserver.adtechus.com/addyn/3.0/5110/2186116/0/16/ADTECH;loc=100;target=_blank;key=key1+key2+key3+key4;grp=[group];misc=' + new Date().getTime() + '"></scri' + 'pt>');
|
||||
//-->
|
||||
</script><noscript><a href="http://adserver.adtechus.com/adlink/3.0/5110/2186116/0/16/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]" target="_blank"><img src="http://adserver.adtechus.com/adserv/3.0/5110/2186116/0/16/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]" border="0" width="1" height="1"></a></noscript>
|
||||
<!-- End of JavaScript Tag -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Vendored
+2
-2
@@ -19,7 +19,7 @@
|
||||
<div class="pvk-gutter">
|
||||
|
||||
</div>
|
||||
<div class="pvk-content">
|
||||
<div class="pvk-content" id="pc1">
|
||||
<div ng-controller="HeroCtrl" class="hero-unit">
|
||||
<div class="container-fluid" id="cf2">
|
||||
<div class="row-fluid" id="cf2-1">
|
||||
@@ -54,7 +54,7 @@
|
||||
<div class="pvk-gutter">
|
||||
|
||||
</div>
|
||||
<div class="pvk-content">
|
||||
<div class="pvk-content" id="pc2">
|
||||
<div class="container-fluid" id="cf3">
|
||||
<div class="row-fluid">
|
||||
<div ng-cloak="" view-on-display="" ng-controller="MsgCtrl" ng-class="{'displayed': blockIsDisplayed}" class="message-box">
|
||||
|
||||
+100
-78
@@ -2,9 +2,7 @@ package goquery
|
||||
|
||||
import (
|
||||
"code.google.com/p/cascadia"
|
||||
"errors"
|
||||
"exp/html"
|
||||
"fmt"
|
||||
"code.google.com/p/go.net/html"
|
||||
)
|
||||
|
||||
type siblingType int
|
||||
@@ -95,6 +93,48 @@ func (this *Selection) ParentFiltered(selector string) *Selection {
|
||||
return filterAndPush(this, getParentNodes(this.Nodes), selector)
|
||||
}
|
||||
|
||||
// Closest() gets the first element that matches the selector by testing the
|
||||
// element itself and traversing up through its ancestors in the DOM tree.
|
||||
func (this *Selection) Closest(selector string) *Selection {
|
||||
cs := cascadia.MustCompile(selector)
|
||||
|
||||
return pushStack(this, mapNodes(this.Nodes, func(i int, n *html.Node) []*html.Node {
|
||||
// For each node in the selection, test the node itself, then each parent
|
||||
// until a match is found.
|
||||
for ; n != nil; n = n.Parent {
|
||||
if cs.Match(n) {
|
||||
return []*html.Node{n}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}))
|
||||
}
|
||||
|
||||
// ClosestNodes() gets the first element that matches one of the nodes by testing the
|
||||
// element itself and traversing up through its ancestors in the DOM tree.
|
||||
func (this *Selection) ClosestNodes(nodes ...*html.Node) *Selection {
|
||||
return pushStack(this, mapNodes(this.Nodes, func(i int, n *html.Node) []*html.Node {
|
||||
// For each node in the selection, test the node itself, then each parent
|
||||
// until a match is found.
|
||||
for ; n != nil; n = n.Parent {
|
||||
if isInSlice(nodes, n) {
|
||||
return []*html.Node{n}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}))
|
||||
}
|
||||
|
||||
// ClosestSelection() gets the first element that matches one of the nodes in the
|
||||
// Selection by testing the element itself and traversing up through its ancestors
|
||||
// in the DOM tree.
|
||||
func (this *Selection) ClosestSelection(s *Selection) *Selection {
|
||||
if s == nil {
|
||||
return pushStack(this, nil)
|
||||
}
|
||||
return this.ClosestNodes(s.Nodes...)
|
||||
}
|
||||
|
||||
// Parents() gets the ancestors of each element in the current Selection. It
|
||||
// returns a new Selection object with the matched elements.
|
||||
func (this *Selection) Parents() *Selection {
|
||||
@@ -373,9 +413,7 @@ func getParentsNodes(nodes []*html.Node, stopSelector string, stopNodes []*html.
|
||||
}
|
||||
|
||||
// Internal implementation of sibling nodes that return a raw slice of matches.
|
||||
func getSiblingNodes(nodes []*html.Node, st siblingType, untilSelector string,
|
||||
untilNodes []*html.Node) []*html.Node {
|
||||
|
||||
func getSiblingNodes(nodes []*html.Node, st siblingType, untilSelector string, untilNodes []*html.Node) []*html.Node {
|
||||
var f func(*html.Node) bool
|
||||
|
||||
// If the requested siblings are ...Until(), create the test function to
|
||||
@@ -396,32 +434,7 @@ func getSiblingNodes(nodes []*html.Node, st siblingType, untilSelector string,
|
||||
}
|
||||
|
||||
return mapNodes(nodes, func(i int, n *html.Node) []*html.Node {
|
||||
|
||||
// Get the parent and loop through all children
|
||||
if p := n.Parent; p != nil {
|
||||
// For Prev() calls that may return more than one node (unlike Prev()),
|
||||
// start at the current node, and work backwards from there. Since
|
||||
// Prev() returns only one node, no advantage to find the current node
|
||||
// first and loop backwards to find the previous one. Better to just loop
|
||||
// from the start and stop once it is found.
|
||||
if st == siblingPrevAll || st == siblingPrevUntil {
|
||||
// Find the index of this node within its parent's children
|
||||
var i = 0
|
||||
for c := p.FirstChild; c != nil; c = c.NextSibling {
|
||||
if c == n {
|
||||
// Looking for previous nodes, so start at index - 1 backwards
|
||||
return getChildrenWithSiblingType(p, st, n, i-1, -1, f)
|
||||
}
|
||||
i++
|
||||
}
|
||||
// Should never get here.
|
||||
panic(errors.New(fmt.Sprintf("Could not find node %+v in his parent's Child slice.", n)))
|
||||
} else {
|
||||
// Standard loop from start moving forwards.
|
||||
return getChildrenWithSiblingType(p, st, n, 0, 1, f)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
return getChildrenWithSiblingType(n.Parent, st, n, f)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -429,61 +442,72 @@ func getSiblingNodes(nodes []*html.Node, st siblingType, untilSelector string,
|
||||
// based on the sibling type request.
|
||||
func getChildrenNodes(nodes []*html.Node, st siblingType) []*html.Node {
|
||||
return mapNodes(nodes, func(i int, n *html.Node) []*html.Node {
|
||||
return getChildrenWithSiblingType(n, st, nil, 0, 1, nil)
|
||||
return getChildrenWithSiblingType(n, st, nil, nil)
|
||||
})
|
||||
}
|
||||
|
||||
// Gets the children of the specified parent, based on the requested sibling
|
||||
// type, skipping a specified node if required.
|
||||
func getChildrenWithSiblingType(parent *html.Node, st siblingType, skipNode *html.Node,
|
||||
startIndex int, increment int, untilFunc func(*html.Node) bool) (result []*html.Node) {
|
||||
untilFunc func(*html.Node) bool) (result []*html.Node) {
|
||||
|
||||
var prev *html.Node
|
||||
var nFound bool
|
||||
var children = getChildren(parent)
|
||||
var end = len(children)
|
||||
|
||||
for i := startIndex; i >= 0 && i < end; i += increment {
|
||||
c := children[i]
|
||||
|
||||
// Care only about elements unless we explicitly request all types of elements
|
||||
if c.Type == html.ElementNode || st == siblingAllIncludingNonElements {
|
||||
// Is it the existing node?
|
||||
if c == skipNode {
|
||||
// Found the current node
|
||||
nFound = true
|
||||
if st == siblingPrev {
|
||||
// We want the previous node only, so append it and return
|
||||
if prev != nil {
|
||||
result = append(result, prev)
|
||||
// Create the iterator function
|
||||
var iter = func(cur *html.Node) (ret *html.Node) {
|
||||
// Based on the sibling type requested, iterate the right way
|
||||
for {
|
||||
switch st {
|
||||
case siblingAll, siblingAllIncludingNonElements:
|
||||
if cur == nil {
|
||||
// First iteration, start with first child of parent
|
||||
// Skip node if required
|
||||
if ret = parent.FirstChild; ret == skipNode && skipNode != nil {
|
||||
ret = skipNode.NextSibling
|
||||
}
|
||||
} else {
|
||||
// Skip node if required
|
||||
if ret = cur.NextSibling; ret == skipNode && skipNode != nil {
|
||||
ret = skipNode.NextSibling
|
||||
}
|
||||
return
|
||||
}
|
||||
} else if prev == skipNode && st == siblingNext {
|
||||
// We want only the next node and this is it, so append it and return
|
||||
result = append(result, c)
|
||||
case siblingPrev, siblingPrevAll, siblingPrevUntil:
|
||||
if cur == nil {
|
||||
// Start with previous sibling of the skip node
|
||||
ret = skipNode.PrevSibling
|
||||
} else {
|
||||
ret = cur.PrevSibling
|
||||
}
|
||||
case siblingNext, siblingNextAll, siblingNextUntil:
|
||||
if cur == nil {
|
||||
// Start with next sibling of the skip node
|
||||
ret = skipNode.NextSibling
|
||||
} else {
|
||||
ret = cur.NextSibling
|
||||
}
|
||||
default:
|
||||
panic("Invalid sibling type.")
|
||||
}
|
||||
if ret == nil || ret.Type == html.ElementNode || st == siblingAllIncludingNonElements {
|
||||
return
|
||||
} else {
|
||||
// Not a valid node, try again from this one
|
||||
cur = ret
|
||||
}
|
||||
}
|
||||
panic("Unreachable code reached.")
|
||||
}
|
||||
|
||||
for c := iter(nil); c != nil; c = iter(c) {
|
||||
// If this is an ...Until() case, test before append (returns true
|
||||
// if the until condition is reached)
|
||||
if st == siblingNextUntil || st == siblingPrevUntil {
|
||||
if untilFunc(c) {
|
||||
return
|
||||
}
|
||||
// Keep child as previous
|
||||
prev = c
|
||||
|
||||
// If child is not the current node, check if sibling type requires
|
||||
// to add it to the result.
|
||||
if c != skipNode &&
|
||||
(st == siblingAll ||
|
||||
st == siblingAllIncludingNonElements ||
|
||||
((st == siblingPrevAll || st == siblingPrevUntil) && !nFound) ||
|
||||
((st == siblingNextAll || st == siblingNextUntil) && nFound)) {
|
||||
|
||||
// If this is an ...Until() case, test before append (returns true
|
||||
// if the until condition is reached)
|
||||
if st == siblingNextUntil || st == siblingPrevUntil {
|
||||
if untilFunc(c) {
|
||||
return
|
||||
}
|
||||
}
|
||||
result = append(result, c)
|
||||
}
|
||||
}
|
||||
result = append(result, c)
|
||||
if st == siblingNext || st == siblingPrev {
|
||||
// Only one node was requested (immediate next or previous), so exit
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
@@ -504,12 +528,10 @@ func getParentNodes(nodes []*html.Node) []*html.Node {
|
||||
// Returns an array of nodes mapped by calling the callback function once for
|
||||
// each node in the source nodes.
|
||||
func mapNodes(nodes []*html.Node, f func(int, *html.Node) []*html.Node) (result []*html.Node) {
|
||||
|
||||
for i, n := range nodes {
|
||||
if vals := f(i, n); len(vals) > 0 {
|
||||
result = appendWithoutDuplicates(result, vals)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
+217
-120
@@ -5,574 +5,671 @@ import (
|
||||
)
|
||||
|
||||
func TestFind(t *testing.T) {
|
||||
sel := Doc().Root.Find("div.row-fluid")
|
||||
sel := Doc().Find("div.row-fluid")
|
||||
AssertLength(t, sel.Nodes, 9)
|
||||
}
|
||||
|
||||
func TestFindRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find("div.row-fluid")
|
||||
sel := Doc().Find("div.row-fluid")
|
||||
sel2 := sel.Find("a").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestFindNotSelf(t *testing.T) {
|
||||
sel := Doc().Root.Find("h1").Find("h1")
|
||||
sel := Doc().Find("h1").Find("h1")
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestFindInvalidSelector(t *testing.T) {
|
||||
defer AssertPanic(t)
|
||||
Doc().Root.Find(":+ ^")
|
||||
Doc().Find(":+ ^")
|
||||
}
|
||||
|
||||
func TestChainedFind(t *testing.T) {
|
||||
sel := Doc().Root.Find("div.hero-unit").Find(".row-fluid")
|
||||
sel := Doc().Find("div.hero-unit").Find(".row-fluid")
|
||||
AssertLength(t, sel.Nodes, 4)
|
||||
}
|
||||
|
||||
func TestChildren(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content").Children()
|
||||
sel := Doc().Find(".pvk-content").Children()
|
||||
AssertLength(t, sel.Nodes, 5)
|
||||
}
|
||||
|
||||
func TestChildrenRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Children().End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestContents(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content").Contents()
|
||||
sel := Doc().Find(".pvk-content").Contents()
|
||||
AssertLength(t, sel.Nodes, 13)
|
||||
}
|
||||
|
||||
func TestContentsRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Contents().End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestChildrenFiltered(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content").ChildrenFiltered(".hero-unit")
|
||||
sel := Doc().Find(".pvk-content").ChildrenFiltered(".hero-unit")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestChildrenFilteredRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.ChildrenFiltered(".hero-unit").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestContentsFiltered(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content").ContentsFiltered(".hero-unit")
|
||||
sel := Doc().Find(".pvk-content").ContentsFiltered(".hero-unit")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestContentsFilteredRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.ContentsFiltered(".hero-unit").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestChildrenFilteredNone(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-content").ChildrenFiltered("a.btn")
|
||||
sel := Doc().Find(".pvk-content").ChildrenFiltered("a.btn")
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestParent(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid").Parent()
|
||||
sel := Doc().Find(".container-fluid").Parent()
|
||||
AssertLength(t, sel.Nodes, 3)
|
||||
}
|
||||
|
||||
func TestParentRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.Parent().End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestParentBody(t *testing.T) {
|
||||
sel := Doc().Root.Find("body").Parent()
|
||||
sel := Doc().Find("body").Parent()
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestParentFiltered(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid").ParentFiltered(".hero-unit")
|
||||
sel := Doc().Find(".container-fluid").ParentFiltered(".hero-unit")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
AssertClass(t, sel, "hero-unit")
|
||||
}
|
||||
|
||||
func TestParentFilteredRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.ParentFiltered(".hero-unit").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestParents(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid").Parents()
|
||||
sel := Doc().Find(".container-fluid").Parents()
|
||||
AssertLength(t, sel.Nodes, 8)
|
||||
}
|
||||
|
||||
func TestParentsOrder(t *testing.T) {
|
||||
sel := Doc().Root.Find("#cf2").Parents()
|
||||
sel := Doc().Find("#cf2").Parents()
|
||||
AssertLength(t, sel.Nodes, 6)
|
||||
AssertSelectionIs(t, sel, ".hero-unit", ".pvk-content", "div.row-fluid", "#cf1", "body", "html")
|
||||
}
|
||||
|
||||
func TestParentsRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.Parents().End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestParentsFiltered(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid").ParentsFiltered("body")
|
||||
sel := Doc().Find(".container-fluid").ParentsFiltered("body")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestParentsFilteredRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.ParentsFiltered("body").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestParentsUntil(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid").ParentsUntil("body")
|
||||
sel := Doc().Find(".container-fluid").ParentsUntil("body")
|
||||
AssertLength(t, sel.Nodes, 6)
|
||||
}
|
||||
|
||||
func TestParentsUntilRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.ParentsUntil("body").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestParentsUntilSelection(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel2 := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := Doc().Find(".pvk-content")
|
||||
sel = sel.ParentsUntilSelection(sel2)
|
||||
AssertLength(t, sel.Nodes, 3)
|
||||
}
|
||||
|
||||
func TestParentsUntilSelectionRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel2 := Doc().Root.Find(".pvk-content")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := Doc().Find(".pvk-content")
|
||||
sel2 = sel.ParentsUntilSelection(sel2).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestParentsUntilNodes(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel2 := Doc().Root.Find(".pvk-content, .hero-unit")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := Doc().Find(".pvk-content, .hero-unit")
|
||||
sel = sel.ParentsUntilNodes(sel2.Nodes...)
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
}
|
||||
|
||||
func TestParentsUntilNodesRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel2 := Doc().Root.Find(".pvk-content, .hero-unit")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := Doc().Find(".pvk-content, .hero-unit")
|
||||
sel2 = sel.ParentsUntilNodes(sel2.Nodes...).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestParentsFilteredUntil(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid").ParentsFilteredUntil(".pvk-content", "body")
|
||||
sel := Doc().Find(".container-fluid").ParentsFilteredUntil(".pvk-content", "body")
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
}
|
||||
|
||||
func TestParentsFilteredUntilRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.ParentsFilteredUntil(".pvk-content", "body").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestParentsFilteredUntilSelection(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel2 := Doc().Root.Find(".row-fluid")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := Doc().Find(".row-fluid")
|
||||
sel = sel.ParentsFilteredUntilSelection("div", sel2)
|
||||
AssertLength(t, sel.Nodes, 3)
|
||||
}
|
||||
|
||||
func TestParentsFilteredUntilSelectionRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel2 := Doc().Root.Find(".row-fluid")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := Doc().Find(".row-fluid")
|
||||
sel2 = sel.ParentsFilteredUntilSelection("div", sel2).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestParentsFilteredUntilNodes(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel2 := Doc().Root.Find(".row-fluid")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := Doc().Find(".row-fluid")
|
||||
sel = sel.ParentsFilteredUntilNodes("body", sel2.Nodes...)
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestParentsFilteredUntilNodesRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel2 := Doc().Root.Find(".row-fluid")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := Doc().Find(".row-fluid")
|
||||
sel2 = sel.ParentsFilteredUntilNodes("body", sel2.Nodes...).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestSiblings(t *testing.T) {
|
||||
sel := Doc().Root.Find("h1").Siblings()
|
||||
sel := Doc().Find("h1").Siblings()
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestSiblingsRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find("h1")
|
||||
sel := Doc().Find("h1")
|
||||
sel2 := sel.Siblings().End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestSiblings2(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-gutter").Siblings()
|
||||
sel := Doc().Find(".pvk-gutter").Siblings()
|
||||
AssertLength(t, sel.Nodes, 9)
|
||||
}
|
||||
|
||||
func TestSiblings3(t *testing.T) {
|
||||
sel := Doc().Root.Find("body>.container-fluid").Siblings()
|
||||
sel := Doc().Find("body>.container-fluid").Siblings()
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestSiblingsFiltered(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-gutter").SiblingsFiltered(".pvk-content")
|
||||
sel := Doc().Find(".pvk-gutter").SiblingsFiltered(".pvk-content")
|
||||
AssertLength(t, sel.Nodes, 3)
|
||||
}
|
||||
|
||||
func TestSiblingsFilteredRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-gutter")
|
||||
sel := Doc().Find(".pvk-gutter")
|
||||
sel2 := sel.SiblingsFiltered(".pvk-content").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNext(t *testing.T) {
|
||||
sel := Doc().Root.Find("h1").Next()
|
||||
sel := Doc().Find("h1").Next()
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestNextRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find("h1")
|
||||
sel := Doc().Find("h1")
|
||||
sel2 := sel.Next().End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNext2(t *testing.T) {
|
||||
sel := Doc().Root.Find(".close").Next()
|
||||
sel := Doc().Find(".close").Next()
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestNextNone(t *testing.T) {
|
||||
sel := Doc().Root.Find("small").Next()
|
||||
sel := Doc().Find("small").Next()
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestNextFiltered(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid").NextFiltered("div")
|
||||
sel := Doc().Find(".container-fluid").NextFiltered("div")
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
}
|
||||
|
||||
func TestNextFilteredRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid")
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.NextFiltered("div").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNextFiltered2(t *testing.T) {
|
||||
sel := Doc().Root.Find(".container-fluid").NextFiltered("[ng-view]")
|
||||
sel := Doc().Find(".container-fluid").NextFiltered("[ng-view]")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestPrev(t *testing.T) {
|
||||
sel := Doc().Root.Find(".red").Prev()
|
||||
sel := Doc().Find(".red").Prev()
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
AssertClass(t, sel, "green")
|
||||
}
|
||||
|
||||
func TestPrevRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".red")
|
||||
sel := Doc().Find(".red")
|
||||
sel2 := sel.Prev().End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestPrev2(t *testing.T) {
|
||||
sel := Doc().Root.Find(".row-fluid").Prev()
|
||||
sel := Doc().Find(".row-fluid").Prev()
|
||||
AssertLength(t, sel.Nodes, 5)
|
||||
}
|
||||
|
||||
func TestPrevNone(t *testing.T) {
|
||||
sel := Doc().Root.Find("h2").Prev()
|
||||
sel := Doc().Find("h2").Prev()
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestPrevFiltered(t *testing.T) {
|
||||
sel := Doc().Root.Find(".row-fluid").PrevFiltered(".row-fluid")
|
||||
sel := Doc().Find(".row-fluid").PrevFiltered(".row-fluid")
|
||||
AssertLength(t, sel.Nodes, 5)
|
||||
}
|
||||
|
||||
func TestPrevFilteredRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".row-fluid")
|
||||
sel := Doc().Find(".row-fluid")
|
||||
sel2 := sel.PrevFiltered(".row-fluid").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNextAll(t *testing.T) {
|
||||
sel := Doc().Root.Find("#cf2 div:nth-child(1)").NextAll()
|
||||
sel := Doc().Find("#cf2 div:nth-child(1)").NextAll()
|
||||
AssertLength(t, sel.Nodes, 3)
|
||||
}
|
||||
|
||||
func TestNextAllRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find("#cf2 div:nth-child(1)")
|
||||
sel := Doc().Find("#cf2 div:nth-child(1)")
|
||||
sel2 := sel.NextAll().End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNextAll2(t *testing.T) {
|
||||
sel := Doc().Root.Find("div[ng-cloak]").NextAll()
|
||||
sel := Doc().Find("div[ng-cloak]").NextAll()
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestNextAllNone(t *testing.T) {
|
||||
sel := Doc().Root.Find(".footer").NextAll()
|
||||
sel := Doc().Find(".footer").NextAll()
|
||||
AssertLength(t, sel.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestNextAllFiltered(t *testing.T) {
|
||||
sel := Doc().Root.Find("#cf2 .row-fluid").NextAllFiltered("[ng-cloak]")
|
||||
sel := Doc().Find("#cf2 .row-fluid").NextAllFiltered("[ng-cloak]")
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
}
|
||||
|
||||
func TestNextAllFilteredRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find("#cf2 .row-fluid")
|
||||
sel := Doc().Find("#cf2 .row-fluid")
|
||||
sel2 := sel.NextAllFiltered("[ng-cloak]").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNextAllFiltered2(t *testing.T) {
|
||||
sel := Doc().Root.Find(".close").NextAllFiltered("h4")
|
||||
sel := Doc().Find(".close").NextAllFiltered("h4")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestPrevAll(t *testing.T) {
|
||||
sel := Doc().Root.Find("[ng-view]").PrevAll()
|
||||
sel := Doc().Find("[ng-view]").PrevAll()
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
}
|
||||
|
||||
func TestPrevAllOrder(t *testing.T) {
|
||||
sel := Doc().Root.Find("[ng-view]").PrevAll()
|
||||
sel := Doc().Find("[ng-view]").PrevAll()
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
AssertSelectionIs(t, sel, "#cf4", "#cf3")
|
||||
}
|
||||
|
||||
func TestPrevAllRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find("[ng-view]")
|
||||
sel := Doc().Find("[ng-view]")
|
||||
sel2 := sel.PrevAll().End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestPrevAll2(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-gutter").PrevAll()
|
||||
sel := Doc().Find(".pvk-gutter").PrevAll()
|
||||
AssertLength(t, sel.Nodes, 6)
|
||||
}
|
||||
|
||||
func TestPrevAllFiltered(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-gutter").PrevAllFiltered(".pvk-content")
|
||||
sel := Doc().Find(".pvk-gutter").PrevAllFiltered(".pvk-content")
|
||||
AssertLength(t, sel.Nodes, 3)
|
||||
}
|
||||
|
||||
func TestPrevAllFilteredRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-gutter")
|
||||
sel := Doc().Find(".pvk-gutter")
|
||||
sel2 := sel.PrevAllFiltered(".pvk-content").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNextUntil(t *testing.T) {
|
||||
sel := Doc().Root.Find(".alert a").NextUntil("p")
|
||||
sel := Doc().Find(".alert a").NextUntil("p")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
AssertSelectionIs(t, sel, "h4")
|
||||
}
|
||||
|
||||
func TestNextUntil2(t *testing.T) {
|
||||
sel := Doc().Root.Find("#cf2-1").NextUntil("[ng-cloak]")
|
||||
sel := Doc().Find("#cf2-1").NextUntil("[ng-cloak]")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
AssertSelectionIs(t, sel, "#cf2-2")
|
||||
}
|
||||
|
||||
func TestNextUntilOrder(t *testing.T) {
|
||||
sel := Doc().Root.Find("#cf2-1").NextUntil("#cf2-4")
|
||||
sel := Doc().Find("#cf2-1").NextUntil("#cf2-4")
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
AssertSelectionIs(t, sel, "#cf2-2", "#cf2-3")
|
||||
}
|
||||
|
||||
func TestNextUntilRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find("#cf2-1")
|
||||
sel := Doc().Find("#cf2-1")
|
||||
sel2 := sel.PrevUntil("#cf2-4").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNextUntilSelection(t *testing.T) {
|
||||
sel := Doc2().Root.Find("#n2")
|
||||
sel2 := Doc2().Root.Find("#n4")
|
||||
sel := Doc2().Find("#n2")
|
||||
sel2 := Doc2().Find("#n4")
|
||||
sel2 = sel.NextUntilSelection(sel2)
|
||||
AssertLength(t, sel2.Nodes, 1)
|
||||
AssertSelectionIs(t, sel2, "#n3")
|
||||
}
|
||||
|
||||
func TestNextUntilSelectionRollback(t *testing.T) {
|
||||
sel := Doc2().Root.Find("#n2")
|
||||
sel2 := Doc2().Root.Find("#n4")
|
||||
sel := Doc2().Find("#n2")
|
||||
sel2 := Doc2().Find("#n4")
|
||||
sel2 = sel.NextUntilSelection(sel2).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNextUntilNodes(t *testing.T) {
|
||||
sel := Doc2().Root.Find("#n2")
|
||||
sel2 := Doc2().Root.Find("#n5")
|
||||
sel := Doc2().Find("#n2")
|
||||
sel2 := Doc2().Find("#n5")
|
||||
sel2 = sel.NextUntilNodes(sel2.Nodes...)
|
||||
AssertLength(t, sel2.Nodes, 2)
|
||||
AssertSelectionIs(t, sel2, "#n3", "#n4")
|
||||
}
|
||||
|
||||
func TestNextUntilNodesRollback(t *testing.T) {
|
||||
sel := Doc2().Root.Find("#n2")
|
||||
sel2 := Doc2().Root.Find("#n5")
|
||||
sel := Doc2().Find("#n2")
|
||||
sel2 := Doc2().Find("#n5")
|
||||
sel2 = sel.NextUntilNodes(sel2.Nodes...).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestPrevUntil(t *testing.T) {
|
||||
sel := Doc().Root.Find(".alert p").PrevUntil("a")
|
||||
sel := Doc().Find(".alert p").PrevUntil("a")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
AssertSelectionIs(t, sel, "h4")
|
||||
}
|
||||
|
||||
func TestPrevUntil2(t *testing.T) {
|
||||
sel := Doc().Root.Find("[ng-cloak]").PrevUntil(":not([ng-cloak])")
|
||||
sel := Doc().Find("[ng-cloak]").PrevUntil(":not([ng-cloak])")
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
AssertSelectionIs(t, sel, "[ng-cloak]")
|
||||
}
|
||||
|
||||
func TestPrevUntilOrder(t *testing.T) {
|
||||
sel := Doc().Root.Find("#cf2-4").PrevUntil("#cf2-1")
|
||||
sel := Doc().Find("#cf2-4").PrevUntil("#cf2-1")
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
AssertSelectionIs(t, sel, "#cf2-3", "#cf2-2")
|
||||
}
|
||||
|
||||
func TestPrevUntilRollback(t *testing.T) {
|
||||
sel := Doc().Root.Find("#cf2-4")
|
||||
sel := Doc().Find("#cf2-4")
|
||||
sel2 := sel.PrevUntil("#cf2-1").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestPrevUntilSelection(t *testing.T) {
|
||||
sel := Doc2().Root.Find("#n4")
|
||||
sel2 := Doc2().Root.Find("#n2")
|
||||
sel := Doc2().Find("#n4")
|
||||
sel2 := Doc2().Find("#n2")
|
||||
sel2 = sel.PrevUntilSelection(sel2)
|
||||
AssertLength(t, sel2.Nodes, 1)
|
||||
AssertSelectionIs(t, sel2, "#n3")
|
||||
}
|
||||
|
||||
func TestPrevUntilSelectionRollback(t *testing.T) {
|
||||
sel := Doc2().Root.Find("#n4")
|
||||
sel2 := Doc2().Root.Find("#n2")
|
||||
sel := Doc2().Find("#n4")
|
||||
sel2 := Doc2().Find("#n2")
|
||||
sel2 = sel.PrevUntilSelection(sel2).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestPrevUntilNodes(t *testing.T) {
|
||||
sel := Doc2().Root.Find("#n5")
|
||||
sel2 := Doc2().Root.Find("#n2")
|
||||
sel := Doc2().Find("#n5")
|
||||
sel2 := Doc2().Find("#n2")
|
||||
sel2 = sel.PrevUntilNodes(sel2.Nodes...)
|
||||
AssertLength(t, sel2.Nodes, 2)
|
||||
AssertSelectionIs(t, sel2, "#n4", "#n3")
|
||||
}
|
||||
|
||||
func TestPrevUntilNodesRollback(t *testing.T) {
|
||||
sel := Doc2().Root.Find("#n5")
|
||||
sel2 := Doc2().Root.Find("#n2")
|
||||
sel := Doc2().Find("#n5")
|
||||
sel2 := Doc2().Find("#n2")
|
||||
sel2 = sel.PrevUntilNodes(sel2.Nodes...).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNextFilteredUntil(t *testing.T) {
|
||||
sel := Doc2().Root.Find(".two").NextFilteredUntil(".even", ".six")
|
||||
sel := Doc2().Find(".two").NextFilteredUntil(".even", ".six")
|
||||
AssertLength(t, sel.Nodes, 4)
|
||||
AssertSelectionIs(t, sel, "#n3", "#n5", "#nf3", "#nf5")
|
||||
}
|
||||
|
||||
func TestNextFilteredUntilRollback(t *testing.T) {
|
||||
sel := Doc2().Root.Find(".two")
|
||||
sel := Doc2().Find(".two")
|
||||
sel2 := sel.NextFilteredUntil(".even", ".six").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestNextFilteredUntilSelection(t *testing.T) {
|
||||
sel := Doc2().Root.Find(".even")
|
||||
sel2 := Doc2().Root.Find(".five")
|
||||
sel := Doc2().Find(".even")
|
||||
sel2 := Doc2().Find(".five")
|
||||
sel = sel.NextFilteredUntilSelection(".even", sel2)
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
AssertSelectionIs(t, sel, "#n3", "#nf3")
|
||||
}
|
||||
|
||||
func TestNextFilteredUntilSelectionRollback(t *testing.T) {
|
||||
sel := Doc2().Root.Find(".even")
|
||||
sel2 := Doc2().Root.Find(".five")
|
||||
sel := Doc2().Find(".even")
|
||||
sel2 := Doc2().Find(".five")
|
||||
sel3 := sel.NextFilteredUntilSelection(".even", sel2).End()
|
||||
AssertEqual(t, sel, sel3)
|
||||
}
|
||||
|
||||
func TestNextFilteredUntilNodes(t *testing.T) {
|
||||
sel := Doc2().Root.Find(".even")
|
||||
sel2 := Doc2().Root.Find(".four")
|
||||
sel := Doc2().Find(".even")
|
||||
sel2 := Doc2().Find(".four")
|
||||
sel = sel.NextFilteredUntilNodes(".odd", sel2.Nodes...)
|
||||
AssertLength(t, sel.Nodes, 4)
|
||||
AssertSelectionIs(t, sel, "#n2", "#n6", "#nf2", "#nf6")
|
||||
}
|
||||
|
||||
func TestNextFilteredUntilNodesRollback(t *testing.T) {
|
||||
sel := Doc2().Root.Find(".even")
|
||||
sel2 := Doc2().Root.Find(".four")
|
||||
sel := Doc2().Find(".even")
|
||||
sel2 := Doc2().Find(".four")
|
||||
sel3 := sel.NextFilteredUntilNodes(".odd", sel2.Nodes...).End()
|
||||
AssertEqual(t, sel, sel3)
|
||||
}
|
||||
|
||||
func TestPrevFilteredUntil(t *testing.T) {
|
||||
sel := Doc2().Root.Find(".five").PrevFilteredUntil(".odd", ".one")
|
||||
sel := Doc2().Find(".five").PrevFilteredUntil(".odd", ".one")
|
||||
AssertLength(t, sel.Nodes, 4)
|
||||
AssertSelectionIs(t, sel, "#n4", "#n2", "#nf4", "#nf2")
|
||||
}
|
||||
|
||||
func TestPrevFilteredUntilRollback(t *testing.T) {
|
||||
sel := Doc2().Root.Find(".four")
|
||||
sel := Doc2().Find(".four")
|
||||
sel2 := sel.PrevFilteredUntil(".odd", ".one").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestPrevFilteredUntilSelection(t *testing.T) {
|
||||
sel := Doc2().Root.Find(".odd")
|
||||
sel2 := Doc2().Root.Find(".two")
|
||||
sel := Doc2().Find(".odd")
|
||||
sel2 := Doc2().Find(".two")
|
||||
sel = sel.PrevFilteredUntilSelection(".odd", sel2)
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
AssertSelectionIs(t, sel, "#n4", "#nf4")
|
||||
}
|
||||
|
||||
func TestPrevFilteredUntilSelectionRollback(t *testing.T) {
|
||||
sel := Doc2().Root.Find(".even")
|
||||
sel2 := Doc2().Root.Find(".five")
|
||||
sel := Doc2().Find(".even")
|
||||
sel2 := Doc2().Find(".five")
|
||||
sel3 := sel.PrevFilteredUntilSelection(".even", sel2).End()
|
||||
AssertEqual(t, sel, sel3)
|
||||
}
|
||||
|
||||
func TestPrevFilteredUntilNodes(t *testing.T) {
|
||||
sel := Doc2().Root.Find(".even")
|
||||
sel2 := Doc2().Root.Find(".four")
|
||||
sel := Doc2().Find(".even")
|
||||
sel2 := Doc2().Find(".four")
|
||||
sel = sel.PrevFilteredUntilNodes(".odd", sel2.Nodes...)
|
||||
AssertLength(t, sel.Nodes, 2)
|
||||
AssertSelectionIs(t, sel, "#n2", "#nf2")
|
||||
}
|
||||
|
||||
func TestPrevFilteredUntilNodesRollback(t *testing.T) {
|
||||
sel := Doc2().Root.Find(".even")
|
||||
sel2 := Doc2().Root.Find(".four")
|
||||
sel := Doc2().Find(".even")
|
||||
sel2 := Doc2().Find(".four")
|
||||
sel3 := sel.PrevFilteredUntilNodes(".odd", sel2.Nodes...).End()
|
||||
AssertEqual(t, sel, sel3)
|
||||
}
|
||||
|
||||
func TestClosestItself(t *testing.T) {
|
||||
sel := Doc2().Find(".three")
|
||||
sel2 := sel.Closest(".row")
|
||||
AssertLength(t, sel2.Nodes, sel.Length())
|
||||
AssertSelectionIs(t, sel2, "#n3", "#nf3")
|
||||
}
|
||||
|
||||
func TestClosestNoDupes(t *testing.T) {
|
||||
sel := Doc().Find(".span12")
|
||||
sel2 := sel.Closest(".pvk-content")
|
||||
AssertLength(t, sel2.Nodes, 1)
|
||||
AssertClass(t, sel2, "pvk-content")
|
||||
}
|
||||
|
||||
func TestClosestNone(t *testing.T) {
|
||||
sel := Doc().Find("h4")
|
||||
sel2 := sel.Closest("a")
|
||||
AssertLength(t, sel2.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestClosestMany(t *testing.T) {
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.Closest(".pvk-content")
|
||||
AssertLength(t, sel2.Nodes, 2)
|
||||
AssertSelectionIs(t, sel2, "#pc1", "#pc2")
|
||||
}
|
||||
|
||||
func TestClosestRollback(t *testing.T) {
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.Closest(".pvk-content").End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestClosestSelectionItself(t *testing.T) {
|
||||
sel := Doc2().Find(".three")
|
||||
sel2 := sel.ClosestSelection(Doc2().Find(".row"))
|
||||
AssertLength(t, sel2.Nodes, sel.Length())
|
||||
}
|
||||
|
||||
func TestClosestSelectionNoDupes(t *testing.T) {
|
||||
sel := Doc().Find(".span12")
|
||||
sel2 := sel.ClosestSelection(Doc().Find(".pvk-content"))
|
||||
AssertLength(t, sel2.Nodes, 1)
|
||||
AssertClass(t, sel2, "pvk-content")
|
||||
}
|
||||
|
||||
func TestClosestSelectionNone(t *testing.T) {
|
||||
sel := Doc().Find("h4")
|
||||
sel2 := sel.ClosestSelection(Doc().Find("a"))
|
||||
AssertLength(t, sel2.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestClosestSelectionMany(t *testing.T) {
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.ClosestSelection(Doc().Find(".pvk-content"))
|
||||
AssertLength(t, sel2.Nodes, 2)
|
||||
AssertSelectionIs(t, sel2, "#pc1", "#pc2")
|
||||
}
|
||||
|
||||
func TestClosestSelectionRollback(t *testing.T) {
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.ClosestSelection(Doc().Find(".pvk-content")).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
func TestClosestNodesItself(t *testing.T) {
|
||||
sel := Doc2().Find(".three")
|
||||
sel2 := sel.ClosestNodes(Doc2().Find(".row").Nodes...)
|
||||
AssertLength(t, sel2.Nodes, sel.Length())
|
||||
}
|
||||
|
||||
func TestClosestNodesNoDupes(t *testing.T) {
|
||||
sel := Doc().Find(".span12")
|
||||
sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...)
|
||||
AssertLength(t, sel2.Nodes, 1)
|
||||
AssertClass(t, sel2, "pvk-content")
|
||||
}
|
||||
|
||||
func TestClosestNodesNone(t *testing.T) {
|
||||
sel := Doc().Find("h4")
|
||||
sel2 := sel.ClosestNodes(Doc().Find("a").Nodes...)
|
||||
AssertLength(t, sel2.Nodes, 0)
|
||||
}
|
||||
|
||||
func TestClosestNodesMany(t *testing.T) {
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...)
|
||||
AssertLength(t, sel2.Nodes, 2)
|
||||
AssertSelectionIs(t, sel2, "#pc1", "#pc2")
|
||||
}
|
||||
|
||||
func TestClosestNodesRollback(t *testing.T) {
|
||||
sel := Doc().Find(".container-fluid")
|
||||
sel2 := sel.ClosestNodes(Doc().Find(".pvk-content").Nodes...).End()
|
||||
AssertEqual(t, sel, sel2)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"exp/html"
|
||||
"code.google.com/p/go.net/html"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
@@ -12,7 +13,7 @@ import (
|
||||
// to be told, and that's what the Document class is for. It holds the root
|
||||
// document node to manipulate, and can make selections on this document.
|
||||
type Document struct {
|
||||
Root *Selection
|
||||
*Selection
|
||||
Url *url.URL
|
||||
rootNode *html.Node
|
||||
}
|
||||
@@ -32,6 +33,26 @@ func NewDocument(url string) (d *Document, e error) {
|
||||
if e != nil {
|
||||
return
|
||||
}
|
||||
return NewDocumentFromResponse(res)
|
||||
}
|
||||
|
||||
// NewDocumentFromReader() returns a Document from a generic reader.
|
||||
// It returns an error as second value if the reader's data cannot be parsed
|
||||
// as html. It does *not* check if the reader is also an io.Closer, so the
|
||||
// provided reader is never closed by this call, it is the responsibility
|
||||
// of the caller to close it if required.
|
||||
func NewDocumentFromReader(r io.Reader) (d *Document, e error) {
|
||||
root, e := html.Parse(r)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
}
|
||||
return newDocument(root, nil), nil
|
||||
}
|
||||
|
||||
// NewDocumentFromResponse() is another Document constructor that takes an http resonse as argument.
|
||||
// It loads the specified response's document, parses it, and stores the root Document
|
||||
// node, ready to be manipulated.
|
||||
func NewDocumentFromResponse(res *http.Response) (d *Document, e error) {
|
||||
defer res.Body.Close()
|
||||
|
||||
// Parse the HTML into nodes
|
||||
@@ -41,16 +62,15 @@ func NewDocument(url string) (d *Document, e error) {
|
||||
}
|
||||
|
||||
// Create and fill the document
|
||||
d = newDocument(root, res.Request.URL)
|
||||
return
|
||||
return newDocument(root, res.Request.URL), nil
|
||||
}
|
||||
|
||||
// Private constructor, make sure all fields are correctly filled.
|
||||
func newDocument(root *html.Node, url *url.URL) (d *Document) {
|
||||
func newDocument(root *html.Node, url *url.URL) *Document {
|
||||
// Create and fill the document
|
||||
d = &Document{nil, url, root}
|
||||
d.Root = newSingleSelection(root, d)
|
||||
return
|
||||
d := &Document{nil, url, root}
|
||||
d.Selection = newSingleSelection(root, d)
|
||||
return d
|
||||
}
|
||||
|
||||
// Selection represents a collection of nodes matching some criteria. The
|
||||
|
||||
+64
-1
@@ -1,7 +1,8 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"exp/html"
|
||||
"bytes"
|
||||
"code.google.com/p/go.net/html"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
@@ -10,6 +11,8 @@ import (
|
||||
// Test helper functions and members
|
||||
var doc *Document
|
||||
var doc2 *Document
|
||||
var docB *Document
|
||||
var docW *Document
|
||||
|
||||
func Doc() *Document {
|
||||
if doc == nil {
|
||||
@@ -23,6 +26,18 @@ func Doc2() *Document {
|
||||
}
|
||||
return doc2
|
||||
}
|
||||
func DocB() *Document {
|
||||
if docB == nil {
|
||||
docB = LoadDoc("gotesting.html")
|
||||
}
|
||||
return docB
|
||||
}
|
||||
func DocW() *Document {
|
||||
if docW == nil {
|
||||
docW = LoadDoc("gowiki.html")
|
||||
}
|
||||
return docW
|
||||
}
|
||||
|
||||
func AssertLength(t *testing.T, nodes []*html.Node, length int) {
|
||||
if len(nodes) != length {
|
||||
@@ -85,3 +100,51 @@ func TestNewDocument(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewDocumentFromReader(t *testing.T) {
|
||||
cases := []struct {
|
||||
src string
|
||||
err bool
|
||||
sel string
|
||||
cnt int
|
||||
}{
|
||||
0: {
|
||||
src: `
|
||||
<html>
|
||||
<head>
|
||||
<title>Test</title>
|
||||
<body>
|
||||
<h1>Hi</h1>
|
||||
</body>
|
||||
</html>`,
|
||||
sel: "h1",
|
||||
cnt: 1,
|
||||
},
|
||||
1: {
|
||||
// Actually pretty hard to make html.Parse return an error
|
||||
// based on content...
|
||||
src: `<html><body><aef<eqf>>>qq></body></ht>`,
|
||||
},
|
||||
}
|
||||
buf := bytes.NewBuffer(nil)
|
||||
|
||||
for i, c := range cases {
|
||||
buf.Reset()
|
||||
buf.WriteString(c.src)
|
||||
|
||||
d, e := NewDocumentFromReader(buf)
|
||||
if (e != nil) != c.err {
|
||||
if c.err {
|
||||
t.Errorf("[%d] - expected error, got none", i)
|
||||
} else {
|
||||
t.Errorf("[%d] - expected no error, got %s", i, e)
|
||||
}
|
||||
}
|
||||
if c.sel != "" {
|
||||
s := d.Find(c.sel)
|
||||
if s.Length() != c.cnt {
|
||||
t.Errorf("[%d] - expected %d nodes, found %d", i, c.cnt, s.Length())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package goquery
|
||||
|
||||
import (
|
||||
"exp/html"
|
||||
"code.google.com/p/go.net/html"
|
||||
)
|
||||
|
||||
func getChildren(n *html.Node) (result []*html.Node) {
|
||||
|
||||
Reference in New Issue
Block a user