summaryrefslogtreecommitdiff
path: root/test/pathological_tests.py
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-12-27 14:39:47 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-12-29 16:42:26 -0800
commitd1922eb6f17578774866a13fd5428cdd3bc2280d (patch)
tree530dfbde51bbb7a82c85d14cc593e631c7628021 /test/pathological_tests.py
parent4a7d305d220a4081ac7c106199baa940d838ce67 (diff)
Updated tests to use python3.
Diffstat (limited to 'test/pathological_tests.py')
-rw-r--r--test/pathological_tests.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/pathological_tests.py b/test/pathological_tests.py
index 719e317..0e991f9 100644
--- a/test/pathological_tests.py
+++ b/test/pathological_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
@@ -30,8 +30,8 @@ pathological = {
((("> " * 50000) + "a"),
re.compile("(<blockquote>\n){50000}")),
"U+0000 in input":
- ("abc\0de\0",
- re.compile("abc(�)?de(�)?"))
+ ("abc\u0000de\u0000",
+ re.compile("abc\ufffd?de\ufffd?"))
}
whitespace_re = re.compile('/s+/')
@@ -39,24 +39,24 @@ passed = 0
errored = 0
failed = 0
-print "Testing pathological cases:"
+print("Testing pathological cases:")
for description in pathological:
- print description
+ print(description)
(inp, regex) = pathological[description]
[rc, actual, err] = cmark.to_html(inp)
if rc != 0:
errored += 1
- print description
- print "program returned error code %d" % rc
+ print(description)
+ print("program returned error code %d" % rc)
print(err)
elif regex.search(actual):
passed += 1
else:
- print description, 'failed'
- print(actual)
+ print(description, 'failed')
+ print(repr(actual))
failed += 1
-print "%d passed, %d failed, %d errored" % (passed, failed, errored)
+print("%d passed, %d failed, %d errored" % (passed, failed, errored))
if (failed == 0 and errored == 0):
exit(0)
else: