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
b4cb664d
Kaydet (Commit)
b4cb664d
authored
Nis 19, 2003
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
New file.
üst
78e2f06c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
0 deletions
+90
-0
test_stringprep.py
Lib/test/test_stringprep.py
+90
-0
No files found.
Lib/test/test_stringprep.py
0 → 100644
Dosyayı görüntüle @
b4cb664d
# To fully test this module, we would need a copy of the stringprep tables.
# Since we don't have them, this test checks only a few codepoints.
from
test.test_support
import
verify
,
vereq
import
sha
import
stringprep
from
stringprep
import
*
verify
(
in_table_a1
(
u"
\u0221
"
))
verify
(
not
in_table_a1
(
u"
\u0222
"
))
verify
(
in_table_b1
(
u"
\u00ad
"
))
verify
(
not
in_table_b1
(
u"
\u00ae
"
))
verify
(
map_table_b2
(
u"
\u0041
"
),
u"
\u0061
"
)
verify
(
map_table_b2
(
u"
\u0061
"
),
u"
\u0061
"
)
verify
(
map_table_b3
(
u"
\u0041
"
),
u"
\u0061
"
)
verify
(
map_table_b3
(
u"
\u0061
"
),
u"
\u0061
"
)
verify
(
in_table_c11
(
u"
\u0020
"
))
verify
(
not
in_table_c11
(
u"
\u0021
"
))
verify
(
in_table_c12
(
u"
\u00a0
"
))
verify
(
not
in_table_c12
(
u"
\u00a1
"
))
verify
(
in_table_c12
(
u"
\u00a0
"
))
verify
(
not
in_table_c12
(
u"
\u00a1
"
))
verify
(
in_table_c11_c12
(
u"
\u00a0
"
))
verify
(
not
in_table_c11_c12
(
u"
\u00a1
"
))
verify
(
in_table_c21
(
u"
\u001f
"
))
verify
(
not
in_table_c21
(
u"
\u0020
"
))
verify
(
in_table_c22
(
u"
\u009f
"
))
verify
(
not
in_table_c22
(
u"
\u00a0
"
))
verify
(
in_table_c21_c22
(
u"
\u009f
"
))
verify
(
not
in_table_c21_c22
(
u"
\u00a0
"
))
verify
(
in_table_c3
(
u"
\ue000
"
))
verify
(
not
in_table_c3
(
u"
\uf900
"
))
verify
(
in_table_c4
(
u"
\uffff
"
))
verify
(
not
in_table_c4
(
u"
\u0000
"
))
verify
(
in_table_c5
(
u"
\ud800
"
))
verify
(
not
in_table_c5
(
u"
\ud7ff
"
))
verify
(
in_table_c6
(
u"
\ufff9
"
))
verify
(
not
in_table_c6
(
u"
\ufffe
"
))
verify
(
in_table_c7
(
u"
\u2ff0
"
))
verify
(
not
in_table_c7
(
u"
\u2ffc
"
))
verify
(
in_table_c8
(
u"
\u0340
"
))
verify
(
not
in_table_c8
(
u"
\u0342
"
))
# C.9 is not in the bmp
# verify(in_table_c9(u"\U000E0001"))
# verify(not in_table_c8(u"\U000E0002"))
verify
(
in_table_d1
(
u"
\u05be
"
))
verify
(
not
in_table_d1
(
u"
\u05bf
"
))
verify
(
in_table_d2
(
u"
\u0041
"
))
verify
(
not
in_table_d2
(
u"
\u0040
"
))
# This would generate a hash of all predicates. However, running
# it is quite expensive, and only serves to detect changes in the
# unicode database. Instead, stringprep.py asserts the version of
# of the database.
# predicates = [k for k in dir(stringprep) if k.startswith("in_table")]
# predicates.sort()
# for p in predicates:
# f = getattr(stringprep, p)
# # Collect all BMP code points
# data = ["0"] * 0x10000
# for i in range(0x10000):
# if f(unichr(i)):
# data[i] = "1"
# data = "".join(data)
# h = sha.sha()
# h.update(data)
# print p,h.hexdigest()
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