...
1
2
3
4
5
6
7 package description
8
9 import (
10 "path"
11 "testing"
12
13 "go.mongodb.org/mongo-driver/internal/spectest"
14 )
15
16 const selectorTestsDir = "../../testdata/server-selection/server_selection"
17
18
19 func TestServerSelectionSpec(t *testing.T) {
20 for _, topology := range [...]string{
21 "ReplicaSetNoPrimary",
22 "ReplicaSetWithPrimary",
23 "Sharded",
24 "Single",
25 "Unknown",
26 "LoadBalanced",
27 } {
28 for _, subdir := range [...]string{"read", "write"} {
29 subdirPath := path.Join(topology, subdir)
30
31 for _, file := range spectest.FindJSONFilesInDir(t,
32 path.Join(selectorTestsDir, subdirPath)) {
33
34 runTest(t, selectorTestsDir, subdirPath, file)
35 }
36 }
37 }
38 }
39
View as plain text