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
5e36edba
Kaydet (Commit)
5e36edba
authored
Tem 20, 2012
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Port additional tests from #14579 (the issue is already fixed).
üst
cc409f4e
b4bbee25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
test_codecs.py
Lib/test/test_codecs.py
+26
-4
No files found.
Lib/test/test_codecs.py
Dosyayı görüntüle @
5e36edba
...
...
@@ -557,8 +557,19 @@ class UTF16LETest(ReadTest):
)
def
test_errors
(
self
):
self
.
assertRaises
(
UnicodeDecodeError
,
codecs
.
utf_16_le_decode
,
b
"
\xff
"
,
"strict"
,
True
)
tests
=
[
(
b
'
\xff
'
,
'
\ufffd
'
),
(
b
'A
\x00
Z'
,
'A
\ufffd
'
),
(
b
'A
\x00
B
\x00
C
\x00
D
\x00
Z'
,
'ABCD
\ufffd
'
),
(
b
'
\x00\xd8
'
,
'
\ufffd
'
),
(
b
'
\x00\xd8
A'
,
'
\ufffd
'
),
(
b
'
\x00\xd8
A
\x00
'
,
'
\ufffd
A'
),
(
b
'
\x00\xdc
A
\x00
'
,
'
\ufffd
A'
),
]
for
raw
,
expected
in
tests
:
self
.
assertRaises
(
UnicodeDecodeError
,
codecs
.
utf_16_le_decode
,
raw
,
'strict'
,
True
)
self
.
assertEqual
(
raw
.
decode
(
'utf-16le'
,
'replace'
),
expected
)
def
test_nonbmp
(
self
):
self
.
assertEqual
(
"
\U00010203
"
.
encode
(
self
.
encoding
),
...
...
@@ -585,8 +596,19 @@ class UTF16BETest(ReadTest):
)
def
test_errors
(
self
):
self
.
assertRaises
(
UnicodeDecodeError
,
codecs
.
utf_16_be_decode
,
b
"
\xff
"
,
"strict"
,
True
)
tests
=
[
(
b
'
\xff
'
,
'
\ufffd
'
),
(
b
'
\x00
A
\xff
'
,
'A
\ufffd
'
),
(
b
'
\x00
A
\x00
B
\x00
C
\x00
DZ'
,
'ABCD
\ufffd
'
),
(
b
'
\xd8\x00
'
,
'
\ufffd
'
),
(
b
'
\xd8\x00\xdc
'
,
'
\ufffd
'
),
(
b
'
\xd8\x00\x00
A'
,
'
\ufffd
A'
),
(
b
'
\xdc\x00\x00
A'
,
'
\ufffd
A'
),
]
for
raw
,
expected
in
tests
:
self
.
assertRaises
(
UnicodeDecodeError
,
codecs
.
utf_16_be_decode
,
raw
,
'strict'
,
True
)
self
.
assertEqual
(
raw
.
decode
(
'utf-16be'
,
'replace'
),
expected
)
def
test_nonbmp
(
self
):
self
.
assertEqual
(
"
\U00010203
"
.
encode
(
self
.
encoding
),
...
...
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