Working but i shouldve made connections a map

This commit is contained in:
Bel LaPointe
2020-07-22 21:54:24 -06:00
parent 9338cf86c9
commit 82975a7101
9 changed files with 112 additions and 20 deletions

View File

@@ -30,6 +30,9 @@ func TestOneMarshalBSON(t *testing.T) {
"modified changes": {
one: (One{Name: "hello", Type: "world", Modified: 1}),
},
"w/ connections": {
one: (One{Name: "hello", Type: "world", Modified: 1, Connections: []One{One{Name: "hi", Relationship: "mom"}}}),
},
}
for name, d := range cases {
@@ -53,6 +56,9 @@ func TestOneMarshalBSON(t *testing.T) {
}
c.one.Modified = 0
one.Modified = 0
for i := range one.Connections {
one.Connections[i].Modified = 0
}
if fmt.Sprint(c.one) != fmt.Sprint(one) {
t.Error(c.one, one)
}