neoneo-go/pkg/core/storage/boltdb_store_test.go
AnnaShaleva aefb6f9fee *: fix tests failing due to path.Join usage
Solution:
Use `file/filepath` package to construct expected path. This package is OS-aware, see https://github.com/golang/go/issues/30616.
2021-11-29 11:11:09 +03:00

16 lines
337 B
Go

package storage
import (
"path/filepath"
"testing"
"github.com/stretchr/testify/require"
)
func newBoltStoreForTesting(t testing.TB) Store {
d := t.TempDir()
testFileName := filepath.Join(d, "test_bolt_db")
boltDBStore, err := NewBoltDBStore(BoltDBOptions{FilePath: testFileName})
require.NoError(t, err)
return boltDBStore
}