1234567891011121314151617181920212223242526272829303132333435 |
- package test
- import (
- "fmt"
- "testing"
- )
- var unit_test = "ddl"
- var INS = []string{
- "INSERT INTO gotab1 VALUES(1, 0.27, 0.99);",
- "INSERT INTO gotab1 VALUES(1, NULL, NULL);",
- "INSERT INTO gotab2 VALUES(1, 'XuguSQL', '2020-01-01 00:00:00');",
- "INSERT INTO gotab2 VALUES(1, '', NULL);"}
- func TestDbexec(t *testing.T) {
- for _, sql := range INS {
- _, err := db.Exec(sql)
- if err != nil {
- fmt.Printf("[ERROR] %s\n", err.Error())
- continue
- }
- fmt.Printf("%s ... ok\n", sql)
- }
- err := db.Close()
- if err != nil {
- fmt.Printf("[ERROR] %s\n", err.Error())
- }
- }
|