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
0ce45d93
Commit
0ce45d93
authored
Jun 27, 2002
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate the tests for name interning from PyXML (test_pyexpat.py
revision 1.12 in PyXML).
parent
eced551a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
Lib/test/test_pyexpat.py
Lib/test/test_pyexpat.py
+18
-0
No files found.
Lib/test/test_pyexpat.py
View file @
0ce45d93
...
...
@@ -200,3 +200,21 @@ else:
# http://mail.python.org/pipermail/xml-sig/2001-April/005202.html
#
expat
.
ParserCreate
(
namespace_separator
=
''
)
# too short
# Test the interning machinery.
p
=
expat
.
ParserCreate
()
L
=
[]
def
collector
(
name
,
*
args
):
L
.
append
(
name
)
p
.
StartElementHandler
=
collector
p
.
EndElementHandler
=
collector
p
.
Parse
(
"<e> <e/> <e></e> </e>"
,
1
)
tag
=
L
[
0
]
if
len
(
L
)
!=
6
:
print
"L should only contain 6 entries; found"
,
len
(
L
)
for
entry
in
L
:
if
tag
is
not
entry
:
print
"expected L to contain many references to the same string"
,
print
"(it didn't)"
print
"L ="
,
`L`
break
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