mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-14 22:56:36 +08:00
改进单元测试,以便于可以使用go test ../...进行执行
This commit is contained in:
@@ -4,6 +4,7 @@ package kvstore_test
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils/kvstore"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils/testutils"
|
||||
"github.com/cockroachdb/pebble"
|
||||
"testing"
|
||||
)
|
||||
@@ -38,11 +39,17 @@ func testInspectDB(t *testing.T) {
|
||||
_ = it.Close()
|
||||
}()
|
||||
|
||||
var isSingleTesting = testutils.IsSingleTesting()
|
||||
|
||||
for it.First(); it.Valid(); it.Next() {
|
||||
valueBytes, valueErr := it.ValueAndErr()
|
||||
if valueErr != nil {
|
||||
t.Fatal(valueErr)
|
||||
}
|
||||
t.Log(string(it.Key()), "=>", string(valueBytes))
|
||||
|
||||
if !isSingleTesting {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user