diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-06-03 14:38:15 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-06-03 14:38:15 +0200 |
commit | 9ac6ccf3a882c861b131c38160728a1d1e12e9ec (patch) | |
tree | 292d921cd9492e99c51df3137703e8fc91a94100 | |
parent | 65056eabe93702620d64449761c980b0ab3292ff (diff) |
Revert "Hacks to spec_tests.py to test CRLF support."
This reverts commit 6f99ff72519a34517285b070cb222de42d8acdfd.
We'll add a separate test for line endings.
-rwxr-xr-x | test/spec_tests.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/test/spec_tests.py b/test/spec_tests.py index 6fd43ef..b1b0373 100755 --- a/test/spec_tests.py +++ b/test/spec_tests.py @@ -36,7 +36,7 @@ def print_test_header(headertext, example_number, start_line, end_line): print("Example %d (lines %d-%d) %s" % (example_number,start_line,end_line,headertext)) def do_test(test, normalize, result_counts): - [retcode, actual_html, err] = cmark.to_html(re.sub(r"\n", "\r\n", test['markdown'])) + [retcode, actual_html, err] = cmark.to_html(test['markdown']) if retcode == 0: expected_html = test['html'] unicode_error = None @@ -52,21 +52,17 @@ def do_test(test, normalize, result_counts): result_counts['pass'] += 1 else: print_test_header(test['section'], test['example'], test['start_line'], test['end_line']) - print("Orig: "+repr(test['markdown'])) - print("Conv: "+repr(re.sub(r"\n", "\r\n", test['markdown']))) -# sys.stdout.write(test['markdown']) + sys.stdout.write(test['markdown']) if unicode_error: print("Unicode error: " + str(unicode_error)) print("Expected: " + repr(expected_html)) print("Got: " + repr(actual_html)) else: - print("Expected: " + repr(expected_html)) - print("Got: " + repr(actual_html)) -# expected_html_lines = expected_html.splitlines(True) -# actual_html_lines = actual_html.splitlines(True) -# for diffline in unified_diff(expected_html_lines, actual_html_lines, -# "expected HTML", "actual HTML"): -# sys.stdout.write(diffline) + expected_html_lines = expected_html.splitlines(True) + actual_html_lines = actual_html.splitlines(True) + for diffline in unified_diff(expected_html_lines, actual_html_lines, + "expected HTML", "actual HTML"): + sys.stdout.write(diffline) sys.stdout.write('\n') result_counts['fail'] += 1 else: |