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
99c0c223
Kaydet (Commit)
99c0c223
authored
Tem 03, 2007
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix test_struct. A bunch of array and bytes issues.
üst
6b826abc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
test_struct.py
Lib/test/test_struct.py
+6
-6
No files found.
Lib/test/test_struct.py
Dosyayı görüntüle @
99c0c223
...
@@ -578,8 +578,8 @@ def test_unpack_from():
...
@@ -578,8 +578,8 @@ def test_unpack_from():
simple_err
(
struct
.
unpack_from
,
fmt
,
data
,
i
)
simple_err
(
struct
.
unpack_from
,
fmt
,
data
,
i
)
def
test_pack_into
():
def
test_pack_into
():
test_string
=
'Reykjavik rocks, eow!'
test_string
=
b
'Reykjavik rocks, eow!'
writable_buf
=
array
.
array
(
'
c'
,
' '
*
100
)
writable_buf
=
array
.
array
(
'
b'
,
b
' '
*
100
)
fmt
=
'21s'
fmt
=
'21s'
s
=
struct
.
Struct
(
fmt
)
s
=
struct
.
Struct
(
fmt
)
...
@@ -594,13 +594,13 @@ def test_pack_into():
...
@@ -594,13 +594,13 @@ def test_pack_into():
vereq
(
from_buf
,
test_string
[:
10
]
+
test_string
)
vereq
(
from_buf
,
test_string
[:
10
]
+
test_string
)
# Go beyond boundaries.
# Go beyond boundaries.
small_buf
=
array
.
array
(
'
c'
,
' '
*
10
)
small_buf
=
array
.
array
(
'
b'
,
b
' '
*
10
)
assertRaises
(
struct
.
error
,
s
.
pack_into
,
small_buf
,
0
,
test_string
)
assertRaises
(
struct
.
error
,
s
.
pack_into
,
small_buf
,
0
,
test_string
)
assertRaises
(
struct
.
error
,
s
.
pack_into
,
small_buf
,
2
,
test_string
)
assertRaises
(
struct
.
error
,
s
.
pack_into
,
small_buf
,
2
,
test_string
)
def
test_pack_into_fn
():
def
test_pack_into_fn
():
test_string
=
'Reykjavik rocks, eow!'
test_string
=
b
'Reykjavik rocks, eow!'
writable_buf
=
array
.
array
(
'
c'
,
' '
*
100
)
writable_buf
=
array
.
array
(
'
b'
,
b
' '
*
100
)
fmt
=
'21s'
fmt
=
'21s'
pack_into
=
lambda
*
args
:
struct
.
pack_into
(
fmt
,
*
args
)
pack_into
=
lambda
*
args
:
struct
.
pack_into
(
fmt
,
*
args
)
...
@@ -615,7 +615,7 @@ def test_pack_into_fn():
...
@@ -615,7 +615,7 @@ def test_pack_into_fn():
vereq
(
from_buf
,
test_string
[:
10
]
+
test_string
)
vereq
(
from_buf
,
test_string
[:
10
]
+
test_string
)
# Go beyond boundaries.
# Go beyond boundaries.
small_buf
=
array
.
array
(
'
c'
,
' '
*
10
)
small_buf
=
array
.
array
(
'
b'
,
b
' '
*
10
)
assertRaises
(
struct
.
error
,
pack_into
,
small_buf
,
0
,
test_string
)
assertRaises
(
struct
.
error
,
pack_into
,
small_buf
,
0
,
test_string
)
assertRaises
(
struct
.
error
,
pack_into
,
small_buf
,
2
,
test_string
)
assertRaises
(
struct
.
error
,
pack_into
,
small_buf
,
2
,
test_string
)
...
...
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