2014-08-15 06:46:48 +04:00
|
|
|
// +build hyperleveldb
|
|
|
|
|
2014-08-11 20:54:53 +04:00
|
|
|
package store
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/siddontang/ledisdb/config"
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func newTestHyperLevelDB() *DB {
|
|
|
|
cfg := new(config.Config)
|
|
|
|
cfg.DBName = "hyperleveldb"
|
|
|
|
cfg.DataDir = "/tmp/testdb"
|
|
|
|
|
|
|
|
os.RemoveAll(getStorePath(cfg))
|
|
|
|
|
|
|
|
db, err := Open(cfg)
|
|
|
|
if err != nil {
|
|
|
|
println(err.Error())
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return db
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestHyperLevelDB(t *testing.T) {
|
|
|
|
db := newTestHyperLevelDB()
|
|
|
|
|
|
|
|
testStore(db, t)
|
|
|
|
|
|
|
|
db.Close()
|
|
|
|
}
|