Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Handle nil BundleData when unmarshalling from bson #211
Conversation
axw
reviewed
May 27, 2016
| + var bd charm.BundleData | ||
| + err := bd.SetBSON(bson.Raw{10, []byte(nil)}) | ||
| + c.Assert(err, gc.Equals, bson.SetZero) | ||
| +} |
axw
May 27, 2016
Member
Can you make the test more about the expected behaviour? The bson.SetZero malarkey is more about the bson internals, rather than what we expect of the de/serialisation.
i.e. marshal an empty BundleData, and unmarshal into a *BundleData and check that it's nil on the way back in.
|
LGTM with a higher-level test. |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-charm |
jujubot
merged commit 503191d
into
juju:v6-unstable
May 27, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wallyworld commentedMay 27, 2016
A small fix for bson unmarshall to properly return SetZero when there's no data.