Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Tests for JSON serialisation of statediff/vmtrace #1241

Merged
merged 6 commits into from Jun 8, 2016
Merged

Conversation

gavofyork
Copy link
Contributor

No description provided.

@gavofyork gavofyork added the A0-pleasereview 🤓 Pull request needs code review. label Jun 7, 2016
@gavofyork
Copy link
Contributor Author

closes #1239

@debris debris added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jun 8, 2016
};
let serialized = serde_json::to_string(&t).unwrap();
assert_eq!(serialized, "{\"code\":[0,1,2,3],\"ops\":[{\"pc\":0,\"cost\":10,\"ex\":null,\"sub\":null},{\"pc\":1,\"cost\":11,\"ex\":{\"used\":10,\"push\":[\"0x45\"],\"mem\":null,\"store\":null},\"sub\":{\"code\":[0],\"ops\":[{\"pc\":0,\"cost\":0,\"ex\":{\"used\":10,\"push\":[\"0x2a\"],\"mem\":{\"off\":42,\"data\":[1,2,3]},\"store\":{\"key\":\"0x45\",\"val\":\"0x2a\"}},\"sub\":null}]}}]}");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

escaped string literals (r#"..."#) would help readability here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will make a new PR.

@gavofyork gavofyork merged commit 293d9f1 into master Jun 8, 2016
@gavofyork gavofyork deleted the jsonsertests branch June 8, 2016 19:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants