Skip to content

Instantly share code, notes, and snippets.

@philips
Created June 28, 2011 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philips/1052022 to your computer and use it in GitHub Desktop.
Save philips/1052022 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import simplejson
from datadiff import diff
actual = simplejson.loads('["foo", {"bar":["baz", null, 1.0, 2]}]')
expected = simplejson.loads('["foo", {"bar":["zap", null, 2.0, 2]}]')
print diff(actual, expected)
--- a
+++ b
[
@@ -0,1 +0,1 @@
'foo',
{
'bar': [
@@ -0,3 +0,3 @@
-'baz',
+'zap',
None,
-1.0,
2,
+2,
],
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment