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
91751143
Kaydet (Commit)
91751143
authored
Mar 21, 2001
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add test cases for the fnmatch module.
üst
cd1b1dd6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
test_fnmatch
Lib/test/output/test_fnmatch
+1
-0
test_fnmatch.py
Lib/test/test_fnmatch.py
+42
-0
No files found.
Lib/test/output/test_fnmatch
0 → 100644
Dosyayı görüntüle @
91751143
test_fnmatch
Lib/test/test_fnmatch.py
0 → 100644
Dosyayı görüntüle @
91751143
"""Test cases for the fnmatch module."""
import
re
import
test_support
import
unittest
from
fnmatch
import
fnmatch
,
fnmatchcase
class
FnmatchTestCase
(
unittest
.
TestCase
):
def
check_match
(
self
,
filename
,
pattern
,
should_match
=
1
):
if
should_match
:
self
.
assert_
(
fnmatch
(
filename
,
pattern
),
"expected
%
r to match pattern
%
r"
%
(
filename
,
pattern
))
else
:
self
.
assert_
(
not
fnmatch
(
filename
,
pattern
),
"expected
%
r not to match pattern
%
r"
%
(
filename
,
pattern
))
def
test_fnmatch
(
self
):
check
=
self
.
check_match
check
(
'abc'
,
'abc'
)
check
(
'abc'
,
'?*?'
)
check
(
'abc'
,
'???*'
)
check
(
'abc'
,
'*???'
)
check
(
'abc'
,
'???'
)
check
(
'abc'
,
'*'
)
check
(
'abc'
,
'ab[cd]'
)
check
(
'abc'
,
'ab[!de]'
)
check
(
'abc'
,
'ab[de]'
,
0
)
check
(
'a'
,
'??'
,
0
)
check
(
'a'
,
'b'
,
0
)
# these test that '\' is handled correctly in character sets;
# see SF bug #???
check
(
'
\\
'
,
r'[\]'
)
check
(
'a'
,
r'[!\]'
)
check
(
'
\\
'
,
r'[!\]'
,
0
)
test_support
.
run_unittest
(
FnmatchTestCase
)
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