Skip to content

Commit

Permalink
eskip: use larger predicate for BenchmarkParsePredicates
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Yastrebov <[email protected]>
  • Loading branch information
AlexanderYastrebov committed Dec 1, 2023
1 parent 0cdb93a commit c870e5f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion eskip/eskip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
)

func checkItems(t *testing.T, message string, l, lenExpected int, checkItem func(int) bool) bool {
t.Helper()
if l != lenExpected {
t.Error(message, "length", l, lenExpected)
return false
Expand All @@ -25,6 +26,7 @@ func checkItems(t *testing.T, message string, l, lenExpected int, checkItem func
}

func checkFilters(t *testing.T, message string, fs, fsExp []*Filter) bool {
t.Helper()
return checkItems(t, "filters "+message,
len(fs),
len(fsExp),
Expand Down Expand Up @@ -817,7 +819,18 @@ func TestFilterString(t *testing.T) {
}

func BenchmarkParsePredicates(b *testing.B) {
doc := `Foo("bar", "baz")`
doc := `FooBarBazKeyValues(
"https://example.org/foo0", "foobarbaz0",
"https://example.org/foo1", "foobarbaz1",
"https://example.org/foo2", "foobarbaz2",
"https://example.org/foo3", "foobarbaz3",
"https://example.org/foo4", "foobarbaz4",
"https://example.org/foo5", "foobarbaz5",
"https://example.org/foo6", "foobarbaz6",
"https://example.org/foo7", "foobarbaz7",
"https://example.org/foo8", "foobarbaz8",
"https://example.org/foo9", "foobarbaz9")`

_, err := ParsePredicates(doc)
if err != nil {
b.Fatal(err)
Expand Down

0 comments on commit c870e5f

Please sign in to comment.