herald.go/db/db_test.go

32 lines
438 B
Go
Raw Normal View History

package db
import (
"testing"
)
// TestOpenDB test to see if we can open a db
func TestOpenDB(t *testing.T) {
tests := []struct {
name string
2021-12-07 12:45:18 +01:00
want int
}{
{
name: "Open a rocksdb database",
2021-12-07 12:45:18 +01:00
want: 10,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
2021-12-07 12:45:18 +01:00
vals := OpenDB("../resources/tmp.db")
got := vals
if got != tt.want {
2021-12-07 12:45:18 +01:00
t.Errorf("got: %d, want: %d\n", got, tt.want)
}
})
}
}