Skip to content

Commit

Permalink
bson: Add test for embedded unexported struct using the ",inline" flag.
Browse files Browse the repository at this point in the history
This test is currently breaking with Go 1.6 due to changes in the `reflect` package.
  • Loading branch information
Livio Soares committed Feb 23, 2016
1 parent e37b326 commit 6da6d2b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bson/bson_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,13 @@ type inlineDupMap struct {
type inlineBadKeyMap struct {
M map[int]int ",inline"
}
type inlineUnexported struct {
M map[string]interface{} ",inline"
unexported ",inline"
}
type unexported struct {
A int
}

type getterSetterD bson.D

Expand Down Expand Up @@ -1284,6 +1291,7 @@ var twoWayCrossItems = []crossTypeItem{
{&inlineMapInt{A: 1, M: map[string]int{"b": 2}}, map[string]int{"a": 1, "b": 2}},
{&inlineMapInt{A: 1, M: nil}, map[string]int{"a": 1}},
{&inlineMapMyM{A: 1, M: MyM{"b": MyM{"c": 3}}}, map[string]interface{}{"a": 1, "b": map[string]interface{}{"c": 3}}},
{&inlineUnexported{M: map[string]interface{}{"b": 1}, unexported: unexported{A: 2}}, map[string]interface{}{"b": 1, "a": 2}},

// []byte <=> Binary
{&struct{ B []byte }{[]byte("abc")}, map[string]bson.Binary{"b": bson.Binary{Data: []byte("abc")}}},
Expand Down

0 comments on commit 6da6d2b

Please sign in to comment.