1 // Copyright © 2016 Steve Francia <spf@spf13.com>.
3 // Use of this source code is governed by an MIT-style
4 // license that can be found in the LICENSE file.
6 // Viper is a application configuration system.
7 // It believes that applications can be configured a variety of ways
8 // via flags, ENVIRONMENT variables, configuration files retrieved
9 // from the file system, or a remote key/value store.
18 func TestCopyAndInsensitiviseMap(t *testing.T) {
20 given = map[string]interface{}{
22 "Bar": map[interface{}]interface {
27 expected = map[string]interface{}{
29 "bar": map[string]interface {
36 got := copyAndInsensitiviseMap(given)
38 if !reflect.DeepEqual(got, expected) {
39 t.Fatalf("Got %q\nexpected\n%q", got, expected)
42 if _, ok := given["foo"]; ok {
43 t.Fatal("Input map changed")
46 if _, ok := given["bar"]; ok {
47 t.Fatal("Input map changed")
50 m := given["Bar"].(map[interface{}]interface{})
51 if _, ok := m["ABc"]; !ok {
52 t.Fatal("Input map changed")