From ed1bd0410fbc877c1e98fa589aa8461ffe3b96cc Mon Sep 17 00:00:00 2001 From: Ashmita Bohara Date: Sat, 19 Jun 2021 23:24:25 +0800 Subject: [PATCH] Badger: v1 to v3 upgrade Signed-off-by: Ashmita Bohara --- plugin/storage/badger/factory_test.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugin/storage/badger/factory_test.go b/plugin/storage/badger/factory_test.go index 45ab4679a7a..8db1fe3ebee 100644 --- a/plugin/storage/badger/factory_test.go +++ b/plugin/storage/badger/factory_test.go @@ -189,9 +189,20 @@ func TestBadgerMetrics(t *testing.T) { assert.NoError(t, err) } -func TestInitFromOptions(t *testing.T) { +func TestInitFromDefaultOptions(t *testing.T) { f := NewFactory() opts := Options{} f.InitFromOptions(opts) assert.Equal(t, &opts, f.Options) } + +func TestInitFromCustomOptions(t *testing.T) { + f := NewFactory() + opts := Options{ + Primary: NamespaceConfig{ + Truncate: true, + }, + } + f.InitFromOptions(opts) + assert.Equal(t, &opts, f.Options) +}