Mercurial > hg > mercurial-crew-with-dirclash
comparison tests/run-tests.py @ 2703:d32b31e88391
run-tests.py: fix diff output when test-foo.out doesn't exist.
Previously, if test-foo.out doesn't exist and test-foo outputs
something, the first line of the diff will look like this:
-+changeset: 0:0acdaf898367
(note the leading "-")
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Fri, 21 Jul 2006 01:51:17 -0300 |
parents | 133811a7688b |
children | 030d0abdf91b |
comparison
equal
deleted
inserted
replaced
2702:133811a7688b | 2703:d32b31e88391 |
---|---|
242 if os.path.exists(ref): | 242 if os.path.exists(ref): |
243 f = open(ref, "r") | 243 f = open(ref, "r") |
244 ref_out = splitnewlines(f.read()) | 244 ref_out = splitnewlines(f.read()) |
245 f.close() | 245 f.close() |
246 else: | 246 else: |
247 ref_out = [''] | 247 ref_out = [] |
248 if out != ref_out: | 248 if out != ref_out: |
249 diffret = 1 | 249 diffret = 1 |
250 print "\nERROR: %s output changed" % (test) | 250 print "\nERROR: %s output changed" % (test) |
251 show_diff(ref_out, out) | 251 show_diff(ref_out, out) |
252 if ret: | 252 if ret: |