Skip to content

Commit

Permalink
bytecode: fix bytecode tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mjarkk committed Oct 14, 2021
1 parent e2fd1bd commit b2baae2
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions bytecode/bytecode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package bytecode
import (
"encoding/hex"
"fmt"
"hash/fnv"
"strings"
"sync"
"testing"
Expand All @@ -12,13 +11,8 @@ import (
)

func parseQuery(query string) ([]byte, []error) {
i := ParserCtx{
Res: []byte{},
FragmentLocations: []int{},
Query: []byte(query),
Errors: []error{},
Hasher: fnv.New32(),
}
i := NewParserCtx()
i.Query = []byte(query)
i.ParseQueryToBytecode(nil)
return i.Res, i.Errors
}
Expand Down Expand Up @@ -764,13 +758,7 @@ func injectCodeSurviveTest(baseQuery string, extraChars ...[][]byte) {

for _, charsToInject := range toTest {
go func(baseQuery []byte, charsToInject [][]byte) {
parser := ParserCtx{
Res: []byte{},
FragmentLocations: []int{},
Query: []byte{},
Errors: []error{},
Hasher: fnv.New32(),
}
parser := NewParserCtx()

for i := range baseQuery {
tilIndex := baseQuery[:i]
Expand Down

0 comments on commit b2baae2

Please sign in to comment.