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
5c609000
Commit
5c609000
authored
Mar 20, 2008
by
Ka-Ping Yee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a longish test case to stress seek/tell with a stateful decoder.
parent
4ebfbf02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
Lib/test/test_io.py
Lib/test/test_io.py
+20
-10
No files found.
Lib/test/test_io.py
View file @
5c609000
...
...
@@ -577,20 +577,30 @@ class StatefulIncrementalDecoderTest(unittest.TestCase):
"""
test_cases
=
[
# I=1
fixed-length mode
# I=1
, O=1 (fixed-length input == fixed-length output)
(
b'abcd'
,
False
,
'a.b.c.d.'
),
# I=0, O=0
, variable-length mode
# I=0, O=0
(variable-length input, variable-length output)
(
b'oiabcd'
,
True
,
'abcd.'
),
# I=0, O=0
, variable-length mode, should ignore extra periods
# I=0, O=0
(should ignore extra periods)
(
b'oi...abcd...'
,
True
,
'abcd.'
),
# I=0, O=6
(
b'i.o6.x
yz.'
,
False
,
'xyz---
.'
),
# I=2, O=6
# I=0, O=6
(variable-length input, fixed-length output)
(
b'i.o6.x
.xyz.toolongtofit.'
,
False
,
'x-----.xyz---.toolon
.'
),
# I=2, O=6
(fixed-length input < fixed-length output)
(
b'i.i2.o6xyz'
,
True
,
'xy----.z-----.'
),
# I=0, O=3
(
b'i.o3.x.xyz.toolong.'
,
False
,
'x--.xyz.too.'
),
# I=6, O=3
(
b'i.o3.i6.abcdefghijklmnop'
,
True
,
'abc.ghi.mno.'
)
# I=6, O=3 (fixed-length input > fixed-length output)
(
b'i.o3.i6.abcdefghijklmnop'
,
True
,
'abc.ghi.mno.'
),
# I=0, then 3; O=29, then 15 (with longer output)
(
b'i.o29.a.b.cde.o15.abcdefghijabcdefghij.i3.a.b.c.d.ei00k.l.m'
,
True
,
'a----------------------------.'
+
'b----------------------------.'
+
'cde--------------------------.'
+
'abcdefghijabcde.'
+
'a.b------------.'
+
'.c.------------.'
+
'd.e------------.'
+
'k--------------.'
+
'l--------------.'
+
'm--------------.'
)
]
def
testDecoder
(
self
):
...
...
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