start storage tests

This commit is contained in:
Nazar Kanaev
2021-04-05 19:02:31 +01:00
parent 2e5ccc3158
commit 09bfc47ef0
3 changed files with 85 additions and 20 deletions

View File

@@ -0,0 +1,18 @@
package storage
import (
"io"
"log"
"os"
)
func testDB() *Storage {
log.SetOutput(io.Discard)
db, err := New(":memory:")
if err != nil {
os.Stderr.WriteString(err.Error())
os.Exit(1)
}
log.SetOutput(os.Stderr)
return db
}