From 06601574e45439d3ed7949c9c4215821d1b25807 Mon Sep 17 00:00:00 2001 From: Alex Elzenaar Date: Fri, 25 Jan 2019 11:34:23 +1300 Subject: [PATCH] Add tests for triple quotes feature (from 7b259b9) --- test/tm-cases/link_patterns_escape.html | 9 +++++++++ test/tm-cases/link_patterns_escape.opts | 8 ++++++++ test/tm-cases/link_patterns_escape.text | 9 +++++++++ 3 files changed, 26 insertions(+) create mode 100644 test/tm-cases/link_patterns_escape.html create mode 100644 test/tm-cases/link_patterns_escape.opts create mode 100644 test/tm-cases/link_patterns_escape.text diff --git a/test/tm-cases/link_patterns_escape.html b/test/tm-cases/link_patterns_escape.html new file mode 100644 index 00000000..20c42eb4 --- /dev/null +++ b/test/tm-cases/link_patterns_escape.html @@ -0,0 +1,9 @@ +

Recipe 123 and a link to Komodo bug 234 are related.

+ +

This is a link which has a pattern inside the url that shouldn't expand.

+ +

Matched pattern is escaped: PEP 42 might be related too.

+ +

Triple quotes not surrounding a matched pattern: PEP """42""" might be related too.

+ +

"""This is some random text which should not be touched."""

diff --git a/test/tm-cases/link_patterns_escape.opts b/test/tm-cases/link_patterns_escape.opts new file mode 100644 index 00000000..440d5a6d --- /dev/null +++ b/test/tm-cases/link_patterns_escape.opts @@ -0,0 +1,8 @@ +{"extras": ["link-patterns"], + "link_patterns": [ + (re.compile("recipe\s+(\d+)", re.I), r"http://code.activestate.com/recipes/\1/"), + (re.compile("(?:komodo\s+)?bug\s+(\d+)", re.I), r"http://bugs.activestate.com/show_bug.cgi?id=\1"), + (re.compile("PEP\s+(\d+)", re.I), lambda m: "http://www.python.org/dev/peps/pep-%04d/" % int(m.group(1))), + ], +} + diff --git a/test/tm-cases/link_patterns_escape.text b/test/tm-cases/link_patterns_escape.text new file mode 100644 index 00000000..e4cf48af --- /dev/null +++ b/test/tm-cases/link_patterns_escape.text @@ -0,0 +1,9 @@ +"""Recipe 123""" and a link to """Komodo bug 234""" are related. + +This is a link which has a pattern inside the url that shouldn't expand. + +Matched pattern is escaped: """PEP 42""" might be related too. + +Triple quotes not surrounding a matched pattern: PEP """42""" might be related too. + +"""This is some random text which should not be touched."""