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
b85a9760
Kaydet (Commit)
b85a9760
authored
Eyl 15, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Restored re pickling test.
üst
ad24d628
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
test_re.py
Lib/test/test_re.py
+9
-5
No files found.
Lib/test/test_re.py
Dosyayı görüntüle @
b85a9760
...
...
@@ -659,11 +659,15 @@ class ReTests(unittest.TestCase):
res
=
re
.
findall
(
re
.
escape
(
'
\u2620
'
.
encode
(
'utf-8'
)),
b
)
self
.
assertEqual
(
len
(
res
),
2
)
def
pickle_test
(
self
,
pickle
):
oldpat
=
re
.
compile
(
'a(?:b|(c|e){1,2}?|d)+?(.)'
)
s
=
pickle
.
dumps
(
oldpat
)
newpat
=
pickle
.
loads
(
s
)
self
.
assertEqual
(
oldpat
,
newpat
)
def
test_pickling
(
self
):
import
pickle
oldpat
=
re
.
compile
(
'a(?:b|(c|e){1,2}?|d)+?(.)'
,
re
.
UNICODE
)
for
proto
in
range
(
pickle
.
HIGHEST_PROTOCOL
+
1
):
pickled
=
pickle
.
dumps
(
oldpat
,
proto
)
newpat
=
pickle
.
loads
(
pickled
)
self
.
assertEqual
(
newpat
,
oldpat
)
# current pickle expects the _compile() reconstructor in re module
from
re
import
_compile
def
test_constants
(
self
):
self
.
assertEqual
(
re
.
I
,
re
.
IGNORECASE
)
...
...
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