ledisdb/store/rocksdb_test.go

35 lines
431 B
Go
Raw Normal View History

2014-07-28 05:25:40 +04:00
// +build rocksdb
package store
import (
"github.com/siddontang/ledisdb/config"
2014-07-28 05:25:40 +04:00
"os"
2014-07-28 05:25:40 +04:00
"testing"
)
func newTestRocksDB() *DB {
cfg := new(config.Config)
cfg.DBName = "rocksdb"
cfg.DataDir = "/tmp/testdb"
2014-07-28 05:25:40 +04:00
os.RemoveAll(getStorePath(cfg))
2014-07-28 05:25:40 +04:00
db, err := Open(cfg)
if err != nil {
println(err.Error())
panic(err)
}
return db
}
func TestRocksDB(t *testing.T) {
db := newTestRocksDB()
testStore(db, t)
db.Close()
}