Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
corteza
corteza-server
Commits
686b10fd
Commit
686b10fd
authored
4 years ago
by
Denis Arh
Browse files
Options
Download
Email Patches
Plain Diff
Fix kv decoder tests
parent
d0afb17c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
pkg/settings/kv_decoder_test.go
pkg/settings/kv_decoder_test.go
+7
-1
No files found.
pkg/settings/kv_decoder_test.go
View file @
686b10fd
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
)
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment