generated from dogmatiq/template-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compat_test.go
62 lines (56 loc) · 1.02 KB
/
compat_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package sqltest_test
import (
. "github.com/dogmatiq/sqltest"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("func CompatiblePairs()", func() {
It("returns all pairs by default", func() {
expect := []Pair{
{
Product: MySQL,
Driver: MySQLDriver,
},
{
Product: MariaDB,
Driver: MySQLDriver,
},
{
Product: PostgreSQL,
Driver: PGXDriver,
},
{
Product: PostgreSQL,
Driver: PostgresDriver,
},
}
if SQLite3Driver.IsAvailable() {
expect = append(
expect,
Pair{
Product: SQLite,
Driver: SQLite3Driver,
},
)
}
pairs := CompatiblePairs()
Expect(pairs).To(ConsistOf(expect))
})
It("limits results to the provided products", func() {
pairs := CompatiblePairs(MariaDB, PostgreSQL)
Expect(pairs).To(ConsistOf(
Pair{
Product: MariaDB,
Driver: MySQLDriver,
},
Pair{
Product: PostgreSQL,
Driver: PGXDriver,
},
Pair{
Product: PostgreSQL,
Driver: PostgresDriver,
},
))
})
})