From 686b10fd1b2795f8b1ecb383802eea4bc44581a6 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Sun, 31 May 2020 19:33:40 +0200 Subject: [PATCH] Fix kv decoder tests --- pkg/settings/kv_decoder_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/settings/kv_decoder_test.go b/pkg/settings/kv_decoder_test.go index c91b2c97e..8e1244097 100644 --- a/pkg/settings/kv_decoder_test.go +++ b/pkg/settings/kv_decoder_test.go @@ -1,7 +1,6 @@ package settings import ( - "github.com/davecgh/go-spew/spew" "testing" "github.com/jmoiron/sqlx/types" @@ -154,6 +153,7 @@ func TestDecodeKV_WithFinalTag(t *testing.T) { ) var ( + r = require.New(t) aux = dst{} kv = KV{ "notFinal.foo": types.JSONText(`"42"`), @@ -161,4 +161,10 @@ func TestDecodeKV_WithFinalTag(t *testing.T) { "isFinal": types.JSONText(`{"Foo":"final42","Sub":{"SubFoo":42}}`), } ) + + r.NoError(DecodeKV(kv, &aux)) + r.Equal(aux.NotFinal.Foo, "42") + r.Equal(aux.NotFinal.Sub.SubFoo, 42) + r.Equal(aux.IsFinal.Foo, "final42") + r.Equal(aux.IsFinal.Sub.SubFoo, 42) }