File tree Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -37,22 +37,7 @@ var tableNames = []string{
37
37
var tempDir = path .Join (os .TempDir (), "qnote-db" )
38
38
39
39
func openDatabase (t * testing.T ) * Database {
40
- // Ensure there is no left overs
41
- if err := os .MkdirAll (tempDir , 0700 ); err != nil {
42
- t .Fatal (err )
43
- }
44
-
45
- file := path .Join (tempDir , "qnote.db" )
46
- if _ , err := os .Stat (file ); err == nil {
47
- if err := os .Remove (file ); err != nil {
48
- t .Fatal (err )
49
- }
50
- }
51
-
52
- // Would be nice to be able to use a memory only db. Due, to
53
- // the way Go sql.DB does its connection pool we can not.
54
- // https://groups.google.com/forum/#!msg/golang-nuts/AYZl1lNxCfA/LOr30uKy7-oJ
55
- db , err := NewDatabase (file )
40
+ db , err := NewDatabase ("file::memory:?cache=shared" )
56
41
if err != nil {
57
42
t .Fatal (err )
58
43
}
@@ -64,9 +49,6 @@ func closeDatabase(db *Database, t *testing.T) {
64
49
if err := db .Close (); err != nil {
65
50
t .Error (err )
66
51
}
67
- if err := os .Remove (db .DBPath ); err != nil {
68
- t .Fatal (err )
69
- }
70
52
}
71
53
72
54
func TestCreateDatabaseSQLite (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments