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
eabafebf
Commit
eabafebf
authored
Mar 07, 2003
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
This test relied on significant trailing whitespace in a string literal.
Evil.
parent
959c7727
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
Lib/test/test_dis.py
Lib/test/test_dis.py
+12
-7
No files found.
Lib/test/test_dis.py
View file @
eabafebf
...
@@ -10,18 +10,18 @@ import unittest
...
@@ -10,18 +10,18 @@ import unittest
# placement is crucial!!! move the start of _f and you have to adjust the
# placement is crucial!!! move the start of _f and you have to adjust the
# line numbers in dis_f
# line numbers in dis_f
def
_f
(
a
):
def
_f
(
a
):
print
a
print
a
return
1
return
1
dis_f
=
"""
\
dis_f
=
"""
\
13 0 LOAD_FAST 0 (a)
13 0 LOAD_FAST 0 (a)
3 PRINT_ITEM
3 PRINT_ITEM
4 PRINT_NEWLINE
4 PRINT_NEWLINE
14 5 LOAD_CONST 1 (1)
14 5 LOAD_CONST 1 (1)
8 RETURN_VALUE
8 RETURN_VALUE
9 LOAD_CONST 0 (None)
9 LOAD_CONST 0 (None)
12 RETURN_VALUE
12 RETURN_VALUE
"""
"""
class
DisTests
(
unittest
.
TestCase
):
class
DisTests
(
unittest
.
TestCase
):
...
@@ -43,7 +43,12 @@ class DisTests(unittest.TestCase):
...
@@ -43,7 +43,12 @@ class DisTests(unittest.TestCase):
sys
.
stdout
=
s
sys
.
stdout
=
s
dis
.
dis
(
_f
)
dis
.
dis
(
_f
)
sys
.
stdout
=
save_stdout
sys
.
stdout
=
save_stdout
self
.
assertEqual
(
dis_f
,
s
.
getvalue
())
got
=
s
.
getvalue
()
# Trim trailing blanks (if any).
lines
=
got
.
split
(
'
\
n
'
)
lines
=
[
line
.
rstrip
()
for
line
in
lines
]
got
=
'
\
n
'
.
join
(
lines
)
self
.
assertEqual
(
dis_f
,
got
)
def
test_main
():
def
test_main
():
run_unittest
(
DisTests
)
run_unittest
(
DisTests
)
...
...
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