mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
config: add benchmark test
This commit is contained in:
@@ -5,6 +5,16 @@ import (
|
||||
"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) {
|
||||
w := new(variableDetectWalker)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user