mirror of
https://gitlab.com/cznic/sqlite.git
synced 2025-06-11 23:41:48 +00:00
windows: fix TestPersistPragma.3, updates #67
This commit is contained in:
31
all_test.go
31
all_test.go
@ -1401,6 +1401,15 @@ func testBindingError(t *testing.T, query func(db *sql.DB, query string, args ..
|
||||
|
||||
// https://gitlab.com/cznic/sqlite/-/issues/51
|
||||
func TestIssue51(t *testing.T) {
|
||||
tempDir, err := ioutil.TempDir("", "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
os.RemoveAll(tempDir)
|
||||
}()
|
||||
|
||||
fn := filepath.Join(tempDir, "test_issue51.db")
|
||||
db, err := sql.Open(driverName, fn)
|
||||
if err != nil {
|
||||
@ -1531,10 +1540,15 @@ const charset = "abcdefghijklmnopqrstuvwxyz" +
|
||||
|
||||
// https://gitlab.com/cznic/sqlite/-/issues/53
|
||||
func TestIssue53(t *testing.T) {
|
||||
if err := emptyDir(tempDir); err != nil {
|
||||
tempDir, err := ioutil.TempDir("", "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
os.RemoveAll(tempDir)
|
||||
}()
|
||||
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@ -1555,7 +1569,6 @@ func TestIssue53(t *testing.T) {
|
||||
|
||||
defer func() {
|
||||
db.Close()
|
||||
os.Remove(fn)
|
||||
}()
|
||||
|
||||
if _, err := db.Exec(`
|
||||
@ -1584,10 +1597,15 @@ CREATE TABLE IF NOT EXISTS loginst (
|
||||
|
||||
// https://gitlab.com/cznic/sqlite/-/issues/37
|
||||
func TestPersistPragma(t *testing.T) {
|
||||
if err := emptyDir(tempDir); err != nil {
|
||||
tempDir, err := ioutil.TempDir("", "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
os.RemoveAll(tempDir)
|
||||
}()
|
||||
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@ -1680,10 +1698,15 @@ func checkPragmas(db *sql.DB, pragmas []pragmaCfg) error {
|
||||
}
|
||||
|
||||
func TestInMemory(t *testing.T) {
|
||||
if err := emptyDir(tempDir); err != nil {
|
||||
tempDir, err := ioutil.TempDir("", "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
os.RemoveAll(tempDir)
|
||||
}()
|
||||
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
Reference in New Issue
Block a user