for test cases : do remove db file instead of call function db.clear at the very start

This commit is contained in:
silentsai 2014-06-04 14:29:21 +08:00
parent 0d4949f060
commit a7eb1e1884
1 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package ledis package ledis
import ( import (
"os"
"sync" "sync"
"testing" "testing"
) )
@ -27,14 +28,16 @@ func getTestDB() *DB {
} }
} }
`) `)
os.RemoveAll("/tmp/testdb")
os.RemoveAll("/tmp/testdb_binlog")
var err error var err error
testLedis, err = Open(d) testLedis, err = Open(d)
if err != nil { if err != nil {
println(err.Error()) println(err.Error())
panic(err) panic(err)
} }
testLedis.ldb.Clear()
} }
testLedisOnce.Do(f) testLedisOnce.Do(f)