Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f164419d
Commit
f164419d
authored
Jan 14, 1998
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for qualified sub and split
parent
17d85bb1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
Lib/test/test_re.py
Lib/test/test_re.py
+15
-0
No files found.
Lib/test/test_re.py
View file @
f164419d
...
...
@@ -38,6 +38,12 @@ try:
except AssertionError:
raise TestFailed, "re.sub"
try:
assert re.sub('
a
', 'b', '
aaaaa
') == '
bbbbb
'
assert re.sub('
a
', 'b', '
aaaaa
', 1) == '
baaaa
'
except AssertionError:
raise TestFailed, "qualified re.sub"
if verbose:
print '
Running
tests
on
symbolic
references
'
...
...
@@ -115,6 +121,15 @@ try:
except AssertionError:
raise TestFailed, "re.split"
try:
assert re.split(":", ":a:b::c", 2) == ['', '
a
', '
b
::
c
']
assert re.split('
:
', '
a
:
b
:
c
:
d
', 2) == ['
a
', 'b', '
c
:
d
']
assert re.split("(:)", ":a:b::c", 2) == ['', '
:
', '
a
', '
:
', '
b
::
c
']
assert re.split("(:*)", ":a:b::c", 2) == ['', '
:
', '
a
', '
:
', '
b
::
c
']
except AssertionError:
raise TestFailed, "qualified re.split"
if verbose:
print '
Pickling
a
RegexObject
instance
'
import pickle
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment