@@ -11,6 +11,7 @@ import (
1111 "github.com/10gen/migration-verifier/mslices"
1212 "github.com/pkg/errors"
1313 "github.com/samber/lo"
14+ "github.com/stretchr/testify/assert"
1415 "github.com/stretchr/testify/require"
1516 "go.mongodb.org/mongo-driver/bson"
1617 "go.mongodb.org/mongo-driver/bson/primitive"
@@ -22,19 +23,24 @@ import (
2223func TestChangeStreamFilter (t * testing.T ) {
2324 verifier := Verifier {}
2425 verifier .SetMetaDBName ("metadb" )
25- require .Equal (t , []bson.D {{{"$match" , bson.D {{"ns.db" , bson.D {{"$ne" , "metadb" }}}}}}},
26- verifier .GetChangeStreamFilter ())
26+ assert .Contains (t ,
27+ verifier .GetChangeStreamFilter (),
28+ bson.D {
29+ {"$match" , bson.D {{"ns.db" , bson.D {{"$ne" , "metadb" }}}}},
30+ },
31+ )
2732 verifier .srcNamespaces = []string {"foo.bar" , "foo.baz" , "test.car" , "test.chaz" }
28- require .Equal (t , []bson.D {
29- {{"$match" , bson.D {
30- {"$or" , bson.A {
31- bson.D {{"ns" , bson.D {{"db" , "foo" }, {"coll" , "bar" }}}},
32- bson.D {{"ns" , bson.D {{"db" , "foo" }, {"coll" , "baz" }}}},
33- bson.D {{"ns" , bson.D {{"db" , "test" }, {"coll" , "car" }}}},
34- bson.D {{"ns" , bson.D {{"db" , "test" }, {"coll" , "chaz" }}}},
33+ assert .Contains (t ,
34+ verifier .GetChangeStreamFilter (),
35+ bson.D {{"$match" , bson.D {
36+ {"$or" , []bson.D {
37+ {{"ns" , bson.D {{"db" , "foo" }, {"coll" , "bar" }}}},
38+ {{"ns" , bson.D {{"db" , "foo" }, {"coll" , "baz" }}}},
39+ {{"ns" , bson.D {{"db" , "test" }, {"coll" , "car" }}}},
40+ {{"ns" , bson.D {{"db" , "test" }, {"coll" , "chaz" }}}},
3541 }},
3642 }}},
37- }, verifier . GetChangeStreamFilter () )
43+ )
3844}
3945
4046// TestChangeStreamResumability creates a verifier, starts its change stream,
0 commit comments