forked from NotYusta/mysqldump
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsource_test.go
More file actions
38 lines (36 loc) · 773 Bytes
/
source_test.go
File metadata and controls
38 lines (36 loc) · 773 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
package mysqldump
import "testing"
func Test_mergeInsert(t *testing.T) {
type args struct {
insertSQLs []string
}
tests := []struct {
name string
args args
want string
wantErr bool
}{
{
args: args{
insertSQLs: []string{
"INSERT INTO `test` VALUES (1, 'a');",
"INSERT INTO `test` VALUES (2, 'b');",
},
},
want: "INSERT INTO `test` VALUES (1, 'a'), (2, 'b');",
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := mergeInsert(tt.args.insertSQLs)
if (err != nil) != tt.wantErr {
t.Errorf("mergeInsert() error = %v, wantErr %v", err, tt.wantErr)
return
}
if got != tt.want {
t.Errorf("mergeInsert() = %v, want %v", got, tt.want)
}
})
}
}