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
d1ea73b7
Kaydet (Commit)
d1ea73b7
authored
May 04, 2007
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make test_types.py pass.
üst
4355a479
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
test_types.py
Lib/test/test_types.py
+14
-14
No files found.
Lib/test/test_types.py
Dosyayı görüntüle @
d1ea73b7
...
@@ -200,16 +200,16 @@ class TypesTests(unittest.TestCase):
...
@@ -200,16 +200,16 @@ class TypesTests(unittest.TestCase):
self
.
assertEqual
(
a
[
-
100
:
100
:
2
],
'02468'
)
self
.
assertEqual
(
a
[
-
100
:
100
:
2
],
'02468'
)
if
have_unicode
:
if
have_unicode
:
a
=
str
(
'0123456789'
,
'ascii'
)
a
=
str
(
b
'0123456789'
,
'ascii'
)
self
.
assertEqual
(
a
[::],
a
)
self
.
assertEqual
(
a
[::],
a
)
self
.
assertEqual
(
a
[::
2
],
str
(
'02468'
,
'ascii'
))
self
.
assertEqual
(
a
[::
2
],
str
(
b
'02468'
,
'ascii'
))
self
.
assertEqual
(
a
[
1
::
2
],
str
(
'13579'
,
'ascii'
))
self
.
assertEqual
(
a
[
1
::
2
],
str
(
b
'13579'
,
'ascii'
))
self
.
assertEqual
(
a
[::
-
1
],
str
(
'9876543210'
,
'ascii'
))
self
.
assertEqual
(
a
[::
-
1
],
str
(
b
'9876543210'
,
'ascii'
))
self
.
assertEqual
(
a
[::
-
2
],
str
(
'97531'
,
'ascii'
))
self
.
assertEqual
(
a
[::
-
2
],
str
(
b
'97531'
,
'ascii'
))
self
.
assertEqual
(
a
[
3
::
-
2
],
str
(
'31'
,
'ascii'
))
self
.
assertEqual
(
a
[
3
::
-
2
],
str
(
b
'31'
,
'ascii'
))
self
.
assertEqual
(
a
[
-
100
:
100
:],
a
)
self
.
assertEqual
(
a
[
-
100
:
100
:],
a
)
self
.
assertEqual
(
a
[
100
:
-
100
:
-
1
],
a
[::
-
1
])
self
.
assertEqual
(
a
[
100
:
-
100
:
-
1
],
a
[::
-
1
])
self
.
assertEqual
(
a
[
-
100
:
100
:
2
],
str
(
'02468'
,
'ascii'
))
self
.
assertEqual
(
a
[
-
100
:
100
:
2
],
str
(
b
'02468'
,
'ascii'
))
def
test_type_function
(
self
):
def
test_type_function
(
self
):
...
@@ -220,7 +220,7 @@ class TypesTests(unittest.TestCase):
...
@@ -220,7 +220,7 @@ class TypesTests(unittest.TestCase):
self
.
assertRaises
(
ValueError
,
buffer
,
'asdf'
,
-
1
)
self
.
assertRaises
(
ValueError
,
buffer
,
'asdf'
,
-
1
)
self
.
assertRaises
(
TypeError
,
buffer
,
None
)
self
.
assertRaises
(
TypeError
,
buffer
,
None
)
a
=
buffer
(
'asdf'
)
a
=
buffer
(
b
'asdf'
)
hash
(
a
)
hash
(
a
)
b
=
a
*
5
b
=
a
*
5
if
a
==
b
:
if
a
==
b
:
...
@@ -229,7 +229,7 @@ class TypesTests(unittest.TestCase):
...
@@ -229,7 +229,7 @@ class TypesTests(unittest.TestCase):
self
.
fail
(
'repeated buffer has wrong content'
)
self
.
fail
(
'repeated buffer has wrong content'
)
if
str
(
a
*
0
)
!=
''
:
if
str
(
a
*
0
)
!=
''
:
self
.
fail
(
'repeated buffer zero times has wrong content'
)
self
.
fail
(
'repeated buffer zero times has wrong content'
)
if
str
(
a
+
buffer
(
'def'
))
!=
'asdfdef'
:
if
str
(
a
+
buffer
(
b
'def'
))
!=
'asdfdef'
:
self
.
fail
(
'concatenation of buffers yields wrong content'
)
self
.
fail
(
'concatenation of buffers yields wrong content'
)
if
str
(
buffer
(
a
))
!=
'asdf'
:
if
str
(
buffer
(
a
))
!=
'asdf'
:
self
.
fail
(
'composing buffers failed'
)
self
.
fail
(
'composing buffers failed'
)
...
@@ -239,14 +239,14 @@ class TypesTests(unittest.TestCase):
...
@@ -239,14 +239,14 @@ class TypesTests(unittest.TestCase):
self
.
fail
(
'specifying buffer size failed'
)
self
.
fail
(
'specifying buffer size failed'
)
if
str
(
buffer
(
a
,
1
,
2
))
!=
'sd'
:
if
str
(
buffer
(
a
,
1
,
2
))
!=
'sd'
:
self
.
fail
(
'specifying buffer offset and size failed'
)
self
.
fail
(
'specifying buffer offset and size failed'
)
self
.
assertRaises
(
ValueError
,
buffer
,
buffer
(
'asdf'
,
1
),
-
1
)
self
.
assertRaises
(
ValueError
,
buffer
,
buffer
(
b
'asdf'
,
1
),
-
1
)
if
str
(
buffer
(
buffer
(
'asdf'
,
0
,
2
),
0
))
!=
'as'
:
if
str
(
buffer
(
buffer
(
b
'asdf'
,
0
,
2
),
0
))
!=
'as'
:
self
.
fail
(
'composing length-specified buffer failed'
)
self
.
fail
(
'composing length-specified buffer failed'
)
if
str
(
buffer
(
buffer
(
'asdf'
,
0
,
2
),
0
,
5000
))
!=
'as'
:
if
str
(
buffer
(
buffer
(
b
'asdf'
,
0
,
2
),
0
,
5000
))
!=
'as'
:
self
.
fail
(
'composing length-specified buffer failed'
)
self
.
fail
(
'composing length-specified buffer failed'
)
if
str
(
buffer
(
buffer
(
'asdf'
,
0
,
2
),
0
,
-
1
))
!=
'as'
:
if
str
(
buffer
(
buffer
(
b
'asdf'
,
0
,
2
),
0
,
-
1
))
!=
'as'
:
self
.
fail
(
'composing length-specified buffer failed'
)
self
.
fail
(
'composing length-specified buffer failed'
)
if
str
(
buffer
(
buffer
(
'asdf'
,
0
,
2
),
1
,
2
))
!=
's'
:
if
str
(
buffer
(
buffer
(
b
'asdf'
,
0
,
2
),
1
,
2
))
!=
's'
:
self
.
fail
(
'composing length-specified buffer failed'
)
self
.
fail
(
'composing length-specified buffer failed'
)
try
:
a
[
1
]
=
'g'
try
:
a
[
1
]
=
'g'
...
...
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