-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction_count_test.go
More file actions
42 lines (32 loc) · 850 Bytes
/
function_count_test.go
File metadata and controls
42 lines (32 loc) · 850 Bytes
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
package StitchingSQLGo
import (
"testing"
)
//go:generate stitching_sql -type=TestCount_FieldTable -file-name=function_Count_table_stitching_sql_test.go -is-add-import=false
type TestCount_FieldTable struct {
Field1 int
}
func TestCount_Field_RefTableTrue(t *testing.T) {
s, e := SqlBuilder{}, Count{
F: TestCount_FieldTable_F.Field1,
}
if err := e.Field(&s, true); err != nil {
t.Fatal(err)
}
except := " count( test_count__field_table.field1)"
if except != s.String() {
t.Fatalf("except\n%s\nnow\n%s", except, s.String())
}
}
func TestCount_Field_RefTableFalse(t *testing.T) {
s, e := SqlBuilder{}, Count{
F: TestCount_FieldTable_F.Field1,
}
if err := e.Field(&s, false); err != nil {
t.Fatal(err)
}
except := " count( field1)"
if except != s.String() {
t.Fatalf("except\n%s\nnow\n%s", except, s.String())
}
}