summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-02-13 03:01:18 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2003-02-13 03:01:18 (GMT)
commitbb1844148ac4b0866a28f9829c2e3826011dc854 (patch)
tree1bb9b5f27f947f2a735d4fb450948137af92b1a5 /Lib
parent88f115b0d42a70a3e696212e69fa3fa29e655c82 (diff)
downloadcpython-bb1844148ac4b0866a28f9829c2e3826011dc854.zip
cpython-bb1844148ac4b0866a28f9829c2e3826011dc854.tar.gz
cpython-bb1844148ac4b0866a28f9829c2e3826011dc854.tar.bz2
SF patch #682432, add lookbehind tests
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/test/re_tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/re_tests.py b/Lib/test/re_tests.py
index d6f04f0..7ab8eb9 100755
--- a/Lib/test/re_tests.py
+++ b/Lib/test/re_tests.py
@@ -548,6 +548,13 @@ tests = [
('a(?:b|(c|e){1,2}?|d)+?(.)', 'ace', SUCCEED, 'g1 + g2', 'ce'),
('^(.+)?B', 'AB', SUCCEED, 'g1', 'A'),
+ # lookbehind: split by : but not if it is escaped by -.
+ ('(?<!-):(.*?)(?<!-):', 'a:bc-:de:f', SUCCEED, 'g1', 'bc-:de' ),
+ # escaping with \ as we know it
+ ('(?<!\\\):(.*?)(?<!\\\):', 'a:bc\\:de:f', SUCCEED, 'g1', 'bc\\:de' ),
+ # terminating with ' and escaping with ? as in edifact
+ ("(?<!\\?)'(.*?)(?<!\\?)'", "a'bc?'de'f", SUCCEED, 'g1', "bc?'de" ),
+
# Comments using the (?#...) syntax
('w(?# comment', 'w', SYNTAX_ERROR),