changeset 268:8d7e2d7848f1

test.util created with write_delta Convenience for writing a diff between multiline strings.
author Sigurd Meldgaard <stm@daimi.au.dk>
date Wed, 10 Mar 2010 15:10:19 +0100
parents 4632f7313777
children 969224be66ad
files pysmcl/test/util.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pysmcl/test/util.py	Wed Mar 10 15:10:19 2010 +0100
@@ -0,0 +1,9 @@
+from difflib import Differ
+
+def write_delta(a, b):
+    """Writes the diff of two multiline strings"""
+    a = a.split("\n")
+    b = b.split("\n")
+    d = Differ().compare(a,b)
+    for i in d:
+        print i