summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-06-03 11:47:35 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2015-06-03 11:47:35 +0200
commitee82af08672810bc03769b2fb5a5767627d30d36 (patch)
treece59c0527d53dd28e3587d46453a88d6c4306001 /test
parent657061c630cf493aa74ce4a09aebc869813b6916 (diff)
parent60d8ded6a6623ddceec76ea348879638b599ee1f (diff)
Merge branch 'master' of https://github.com/btrask/cmark into btrask-master
Conflicts: src/blocks.c
Diffstat (limited to 'test')
-rwxr-xr-xtest/spec_tests.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/spec_tests.py b/test/spec_tests.py
index b1b0373..6fd43ef 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(test['markdown'])
+ [retcode, actual_html, err] = cmark.to_html(re.sub(r"\n", "\r\n", test['markdown']))
if retcode == 0:
expected_html = test['html']
unicode_error = None
@@ -52,17 +52,21 @@ 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'])
- sys.stdout.write(test['markdown'])
+ print("Orig: "+repr(test['markdown']))
+ print("Conv: "+repr(re.sub(r"\n", "\r\n", 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:
- 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)
+ 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)
sys.stdout.write('\n')
result_counts['fail'] += 1
else: