Skip to content

Commit 7d98fad

Browse files
Move Fuzz tests into separate module
This way the heavy cgo dependency is not required for normal builds. Co-authored-by: Koen Bollen <[email protected]>
1 parent c11954e commit 7d98fad

File tree

9 files changed

+14
-5
lines changed

9 files changed

+14
-5
lines changed

examples/readme_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ func ExampleNewConverter_README() {
3232
fmt.Println(conditions)
3333
fmt.Printf("%#v\n", values)
3434
// Output:
35-
// ((("meta"->>'map' ~* ?) OR ("meta"->>'map' ~* ?)) AND ("meta"->>'password' = $3) AND (("meta"->>'playerCount' >= $4) AND ("meta"->>'playerCount' < $5)))
35+
// ((("meta"->>'map' ~* $1) OR ("meta"->>'map' ~* $2)) AND ("meta"->>'password' = $3) AND (("meta"->>'playerCount' >= $4) AND ("meta"->>'playerCount' < $5)))
3636
// []interface {}{"aztec", "nuke", "", 2, 10}
3737
}

fuzz/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fuzz tests are in a separate module so that the heavy cgo dependency is not required for normal builds.
File renamed without changes.

fuzz/go.mod

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module github.com/poki/mongodb-filter-to-postgres/fuzz
2+
3+
go 1.21.0
4+
5+
replace github.com/poki/mongodb-filter-to-postgres v0.0.0 => ../
6+
7+
require (
8+
github.com/pganalyze/pg_query_go/v5 v5.1.0
9+
github.com/poki/mongodb-filter-to-postgres v0.0.0
10+
)
11+
12+
require google.golang.org/protobuf v1.31.0 // indirect

go.sum renamed to fuzz/go.sum

File renamed without changes.

go.mod

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
module github.com/poki/mongodb-filter-to-postgres
22

33
go 1.21.0
4-
5-
require github.com/pganalyze/pg_query_go/v5 v5.1.0
6-
7-
require google.golang.org/protobuf v1.31.0 // indirect

0 commit comments

Comments
 (0)