Commit 686b10fd authored by Denis Arh's avatar Denis Arh
Browse files

Fix kv decoder tests

parent d0afb17c
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)
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment