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
62666e1d
Kaydet (Commit)
62666e1d
authored
May 24, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
(Merge 3.2) Issue #12057: Add tests for the HZ encoding
üst
1f4560c8
8ed8416c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
hz-utf8.txt
Lib/test/cjkencodings/hz-utf8.txt
+2
-0
hz.txt
Lib/test/cjkencodings/hz.txt
+2
-0
test_codecencodings_cn.py
Lib/test/test_codecencodings_cn.py
+29
-0
No files found.
Lib/test/cjkencodings/hz-utf8.txt
0 → 100644
Dosyayı görüntüle @
62666e1d
This sentence is in ASCII.
The next sentence is in GB.己所不欲,勿施於人。Bye.
Lib/test/cjkencodings/hz.txt
0 → 100644
Dosyayı görüntüle @
62666e1d
This sentence is in ASCII.
The next sentence is in GB.~{<:Ky2;S{#,NpJ)l6HK!#~}Bye.
Lib/test/test_codecencodings_cn.py
Dosyayı görüntüle @
62666e1d
...
...
@@ -50,6 +50,35 @@ class Test_GB18030(test_multibytecodec_support.TestBase, unittest.TestCase):
)
has_iso10646
=
True
class
Test_HZ
(
test_multibytecodec_support
.
TestBase
,
unittest
.
TestCase
):
encoding
=
'hz'
tstring
=
test_multibytecodec_support
.
load_teststring
(
'hz'
)
codectests
=
(
# test '~\n' (3 lines)
(
b
'This sentence is in ASCII.
\n
'
b
'The next sentence is in GB.~{<:Ky2;S{#,~}~
\n
'
b
'~{NpJ)l6HK!#~}Bye.
\n
'
,
'strict'
,
'This sentence is in ASCII.
\n
'
'The next sentence is in GB.'
'
\u5df1\u6240\u4e0d\u6b32\uff0c\u52ff\u65bd\u65bc\u4eba\u3002
'
'Bye.
\n
'
),
# test '~\n' (4 lines)
(
b
'This sentence is in ASCII.
\n
'
b
'The next sentence is in GB.~
\n
'
b
'~{<:Ky2;S{#,NpJ)l6HK!#~}~
\n
'
b
'Bye.
\n
'
,
'strict'
,
'This sentence is in ASCII.
\n
'
'The next sentence is in GB.'
'
\u5df1\u6240\u4e0d\u6b32\uff0c\u52ff\u65bd\u65bc\u4eba\u3002
'
'Bye.
\n
'
),
# invalid bytes
(
b
'ab~cd'
,
'replace'
,
'ab
\uFFFD
d'
),
(
b
'ab
\xff
cd'
,
'replace'
,
'ab
\uFFFD
cd'
),
(
b
'ab~{
\x81\x81\x41\x44
~}cd'
,
'replace'
,
'ab
\uFFFD\uFFFD\u804A
cd'
),
)
def
test_main
():
support
.
run_unittest
(
__name__
)
...
...
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