config: add benchmark test
This commit is contained in:
parent
be83044f59
commit
5bb51e50dd
|
@ -5,6 +5,16 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func BenchmarkVariableDetectWalker(b *testing.B) {
|
||||||
|
w := new(variableDetectWalker)
|
||||||
|
|
||||||
|
str := reflect.ValueOf(`foo ${var.bar} bar ${bar.baz.bing} $${escaped}`)
|
||||||
|
for i := 0; i < b.N; i++ {
|
||||||
|
w.Variables = nil
|
||||||
|
w.Primitive(str)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestVariableDetectWalker(t *testing.T) {
|
func TestVariableDetectWalker(t *testing.T) {
|
||||||
w := new(variableDetectWalker)
|
w := new(variableDetectWalker)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue