From d1922eb6f17578774866a13fd5428cdd3bc2280d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 27 Dec 2014 14:39:47 -0700 Subject: Updated tests to use python3. --- test/pathological_tests.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'test/pathological_tests.py') 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("(
\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: -- cgit v1.2.3