mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 22:21:07 +03:00
Fix case issue Viper vs Blackfriday config
There are still work to be done in the case department, but that will have to be another day. Fixes #2581 See https://github.com/spf13/viper/issues/261
This commit is contained in:
parent
4d6cd3cb2a
commit
40b1b8f703
7 changed files with 102 additions and 16 deletions
|
@ -291,3 +291,56 @@ func TestDoArithmetic(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestToLowerMap(t *testing.T) {
|
||||
|
||||
tests := []struct {
|
||||
input map[string]interface{}
|
||||
expected map[string]interface{}
|
||||
}{
|
||||
{
|
||||
map[string]interface{}{
|
||||
"abC": 32,
|
||||
},
|
||||
map[string]interface{}{
|
||||
"abc": 32,
|
||||
},
|
||||
},
|
||||
{
|
||||
map[string]interface{}{
|
||||
"abC": 32,
|
||||
"deF": map[interface{}]interface{}{
|
||||
23: "A value",
|
||||
24: map[string]interface{}{
|
||||
"AbCDe": "A value",
|
||||
"eFgHi": "Another value",
|
||||
},
|
||||
},
|
||||
"gHi": map[string]interface{}{
|
||||
"J": 25,
|
||||
},
|
||||
},
|
||||
map[string]interface{}{
|
||||
"abc": 32,
|
||||
"def": map[string]interface{}{
|
||||
"23": "A value",
|
||||
"24": map[string]interface{}{
|
||||
"abcde": "A value",
|
||||
"efghi": "Another value",
|
||||
},
|
||||
},
|
||||
"ghi": map[string]interface{}{
|
||||
"j": 25,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for i, test := range tests {
|
||||
// ToLowerMap modifies input.
|
||||
ToLowerMap(test.input)
|
||||
if !reflect.DeepEqual(test.expected, test.input) {
|
||||
t.Errorf("[%d] Expected\n%#v, got\n%#v\n", i, test.expected, test.input)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue