github
3 of 18 new or added lines in 6 files covered. (16.67%)
28537 existing lines in 457 files now uncovered.99094 of 172978 relevant lines covered (57.29%)
1.78 hits per line
| 1 |
package paymentsdb
|
|
| 2 |
|
|
| 3 |
import (
|
|
| 4 |
"testing"
|
|
| 5 |
|
|
| 6 |
"github.com/lightningnetwork/lnd/kvdb"
|
|
| 7 |
"github.com/stretchr/testify/require"
|
|
| 8 |
) |
|
| 9 |
|
|
| 10 |
// NewTestDB is a helper function that creates an BBolt database for testing.
|
|
|
UNCOV
11
|
func NewTestDB(t *testing.T, opts ...OptionModifier) *KVPaymentsDB {
|
× |
|
UNCOV
12
|
backend, backendCleanup, err := kvdb.GetTestBackend( |
× |
|
UNCOV
13
|
t.TempDir(), "kvPaymentDB",
|
× |
|
UNCOV
14
|
) |
× |
|
UNCOV
15
|
require.NoError(t, err) |
× |
|
UNCOV
16
|
|
× |
|
UNCOV
17
|
t.Cleanup(backendCleanup) |
× |
|
UNCOV
18
|
|
× |
|
UNCOV
19
|
paymentDB, err := NewKVPaymentsDB(backend, opts...) |
× |
|
UNCOV
20
|
require.NoError(t, err) |
× |
|
UNCOV
21
|
|
× |
|
UNCOV
22
|
return paymentDB
|
× |
|
UNCOV
23
|
} |
× |