-
Notifications
You must be signed in to change notification settings - Fork 13
/
gqt_test.go
51 lines (41 loc) · 817 Bytes
/
gqt_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
// Copyright 2016 Davide Muzzarelli. All right reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gqt
import (
"os"
"path/filepath"
"testing"
)
var testDir string
func init() {
var err error
testDir, err = os.Getwd()
if err != nil {
panic(err)
}
testDir = filepath.Join(testDir, "test")
}
func Test(t *testing.T) {
for _, dir := range []string{"pkg1", "pkg2"} {
err := Add(filepath.Join(testDir, dir), "*.sql")
if err != nil {
t.Error(err)
}
}
if Get("test1") != "test1" {
t.Error("test1")
}
if Exec("test2", true) != "Yes" {
t.Error("test2")
}
if Get("sub/test3") != "test3" {
t.Error("test3")
}
if Get("test4") != "test4" {
t.Error("test4")
}
if Get("test5") != "test5" {
t.Error("test5")
}
}