Skip to content

Commit

Permalink
fix a benchmark test BenchmarkCompile
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Apr 27, 2024
1 parent f2559f6 commit f694c1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler_test.go
Expand Up @@ -345,14 +345,16 @@ func BenchmarkCompile(b *testing.B) {
if err != nil {
b.Fatal(err)
}
query, err := gojq.Parse(string(cnt))
query, err := gojq.Parse(string(cnt) + ".")
if err != nil {
b.Fatal(err)
}
for i := 0; i < b.N; i++ {
_, err := gojq.Compile(
query,
gojq.WithInputIter(gojq.NewIter()),
gojq.WithFunction("debug", 0, 0,
func(v any, _ []any) any { return v }),
)
if err != nil {
b.Fatal(err)
Expand Down

0 comments on commit f694c1b

Please sign in to comment.