Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
d24a5b60
Kaydet (Commit)
d24a5b60
authored
Mar 20, 2008
tarafından
Ka-Ping Yee
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added a longish test case to stress seek/tell with a stateful decoder.
üst
e25f35ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
test_io.py
Lib/test/test_io.py
+20
-10
No files found.
Lib/test/test_io.py
Dosyayı görüntüle @
d24a5b60
...
@@ -577,20 +577,30 @@ class StatefulIncrementalDecoderTest(unittest.TestCase):
...
@@ -577,20 +577,30 @@ class StatefulIncrementalDecoderTest(unittest.TestCase):
"""
"""
test_cases
=
[
test_cases
=
[
# I=1
fixed-length mode
# I=1
, O=1 (fixed-length input == fixed-length output)
(
b
'abcd'
,
False
,
'a.b.c.d.'
),
(
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.'
),
(
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.'
),
(
b
'oi...abcd...'
,
True
,
'abcd.'
),
# I=0, O=6
# I=0, O=6
(variable-length input, fixed-length output)
(
b
'i.o6.x
yz.'
,
False
,
'xyz---
.'
),
(
b
'i.o6.x
.xyz.toolongtofit.'
,
False
,
'x-----.xyz---.toolon
.'
),
# I=2, O=6
# I=2, O=6
(fixed-length input < fixed-length output)
(
b
'i.i2.o6xyz'
,
True
,
'xy----.z-----.'
),
(
b
'i.i2.o6xyz'
,
True
,
'xy----.z-----.'
),
# I=0, O=3
# I=6, O=3 (fixed-length input > fixed-length output)
(
b
'i.o3.x.xyz.toolong.'
,
False
,
'x--.xyz.too.'
),
(
b
'i.o3.i6.abcdefghijklmnop'
,
True
,
'abc.ghi.mno.'
),
# I=6, O=3
# I=0, then 3; O=29, then 15 (with longer output)
(
b
'i.o3.i6.abcdefghijklmnop'
,
True
,
'abc.ghi.mno.'
)
(
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
):
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