summaryrefslogtreecommitdiffstats
path: root/common/maps/maps_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-06-22 09:53:37 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-06-22 21:38:28 +0200
commit4a9d408fe0bbf4c563546e35d2be7ade4e920c4c (patch)
tree942f920d5b829ab04b2e5786a712a713beb84f53 /common/maps/maps_test.go
parent93120598880ae7c598f186f5259fc4d5a286632f (diff)
config: Fix merge of config with map[string]string values.
Fixes #8679
Diffstat (limited to 'common/maps/maps_test.go')
-rw-r--r--common/maps/maps_test.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/common/maps/maps_test.go b/common/maps/maps_test.go
index dbe97a15a..ba3c25087 100644
--- a/common/maps/maps_test.go
+++ b/common/maps/maps_test.go
@@ -21,10 +21,10 @@ import (
qt "github.com/frankban/quicktest"
)
-func TestToLower(t *testing.T) {
+func TestPrepareParams(t *testing.T) {
tests := []struct {
- input map[string]interface{}
- expected map[string]interface{}
+ input Params
+ expected Params
}{
{
map[string]interface{}{
@@ -47,6 +47,9 @@ func TestToLower(t *testing.T) {
"gHi": map[string]interface{}{
"J": 25,
},
+ "jKl": map[string]string{
+ "M": "26",
+ },
},
Params{
"abc": 32,
@@ -60,13 +63,16 @@ func TestToLower(t *testing.T) {
"ghi": Params{
"j": 25,
},
+ "jkl": Params{
+ "m": "26",
+ },
},
},
}
for i, test := range tests {
t.Run(fmt.Sprint(i), func(t *testing.T) {
- // ToLower modifies input.
+ // PrepareParams modifies input.
PrepareParams(test.input)
if !reflect.DeepEqual(test.expected, test.input) {
t.Errorf("[%d] Expected\n%#v, got\n%#v\n", i, test.expected, test.input)