summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go')
-rw-r--r--vendor/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go b/vendor/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go
index 08e495664..ecfb76987 100644
--- a/vendor/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go
+++ b/vendor/github.com/mitchellh/mapstructure/mapstructure_bugs_test.go
@@ -258,3 +258,21 @@ func TestDecodeSliceToEmptySliceWOZeroing(t *testing.T) {
}
}
}
+
+// #70
+func TestNextSquashMapstructure(t *testing.T) {
+ data := &struct {
+ Level1 struct {
+ Level2 struct {
+ Foo string
+ } `mapstructure:",squash"`
+ } `mapstructure:",squash"`
+ }{}
+ err := Decode(map[interface{}]interface{}{"foo": "baz"}, &data)
+ if err != nil {
+ t.Fatalf("should not error: %s", err)
+ }
+ if data.Level1.Level2.Foo != "baz" {
+ t.Fatal("value should be baz")
+ }
+}