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
d2bf3b7c
Kaydet (Commit)
d2bf3b7c
authored
Ock 18, 2001
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Whitespace normalization. Leaving tokenize_tests.py alone for now.
üst
be4cbb16
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
42 additions
and
45 deletions
+42
-45
string_tests.py
Lib/test/string_tests.py
+1
-1
test_charmapcodec.py
Lib/test/test_charmapcodec.py
+1
-2
test_crypt.py
Lib/test/test_crypt.py
+1
-1
test_format.py
Lib/test/test_format.py
+0
-1
test_sax.py
Lib/test/test_sax.py
+4
-4
test_support.py
Lib/test/test_support.py
+10
-10
test_unicode.py
Lib/test/test_unicode.py
+6
-6
test_xreadline.py
Lib/test/test_xreadline.py
+17
-17
testcodec.py
Lib/test/testcodec.py
+2
-3
No files found.
Lib/test/string_tests.py
Dosyayı görüntüle @
d2bf3b7c
...
@@ -56,7 +56,7 @@ def run_method_tests(test):
...
@@ -56,7 +56,7 @@ def run_method_tests(test):
test
(
'count'
,
'aaa'
,
3
,
'a'
)
test
(
'count'
,
'aaa'
,
3
,
'a'
)
test
(
'count'
,
'aaa'
,
0
,
'b'
)
test
(
'count'
,
'aaa'
,
0
,
'b'
)
test
(
'find'
,
'abcdefghiabc'
,
0
,
'abc'
)
test
(
'find'
,
'abcdefghiabc'
,
0
,
'abc'
)
test
(
'find'
,
'abcdefghiabc'
,
9
,
'abc'
,
1
)
test
(
'find'
,
'abcdefghiabc'
,
9
,
'abc'
,
1
)
test
(
'find'
,
'abcdefghiabc'
,
-
1
,
'def'
,
4
)
test
(
'find'
,
'abcdefghiabc'
,
-
1
,
'def'
,
4
)
...
...
Lib/test/test_charmapcodec.py
Dosyayı görüntüle @
d2bf3b7c
...
@@ -17,7 +17,7 @@ def check(a, b):
...
@@ -17,7 +17,7 @@ def check(a, b):
# test codec's full path name (see test/testcodec.py)
# test codec's full path name (see test/testcodec.py)
codecname
=
'test.testcodec'
codecname
=
'test.testcodec'
check
(
unicode
(
'abc'
,
codecname
),
u'abc'
)
check
(
unicode
(
'abc'
,
codecname
),
u'abc'
)
check
(
unicode
(
'xdef'
,
codecname
),
u'abcdef'
)
check
(
unicode
(
'xdef'
,
codecname
),
u'abcdef'
)
check
(
unicode
(
'defx'
,
codecname
),
u'defabc'
)
check
(
unicode
(
'defx'
,
codecname
),
u'defabc'
)
...
@@ -41,4 +41,3 @@ except UnicodeError:
...
@@ -41,4 +41,3 @@ except UnicodeError:
print
'
\\
001 maps to undefined: OK'
print
'
\\
001 maps to undefined: OK'
else
:
else
:
print
'*** check failed:
\\
001 does not map to undefined'
print
'*** check failed:
\\
001 does not map to undefined'
Lib/test/test_crypt.py
Dosyayı görüntüle @
d2bf3b7c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
Roger E. Masse
Roger E. Masse
"""
"""
from
test_support
import
verify
,
verbose
from
test_support
import
verify
,
verbose
import
crypt
import
crypt
c
=
crypt
.
crypt
(
'mypassword'
,
'ab'
)
c
=
crypt
.
crypt
(
'mypassword'
,
'ab'
)
...
...
Lib/test/test_format.py
Dosyayı görüntüle @
d2bf3b7c
...
@@ -198,4 +198,3 @@ test_exc('abc %a', 1, ValueError,
...
@@ -198,4 +198,3 @@ test_exc('abc %a', 1, ValueError,
"unsupported format character 'a' (0x61) at index 5"
)
"unsupported format character 'a' (0x61) at index 5"
)
test_exc
(
u'abc
%
\u3000
'
,
1
,
ValueError
,
test_exc
(
u'abc
%
\u3000
'
,
1
,
ValueError
,
"unsupported format character '?' (0x3000) at index 5"
)
"unsupported format character '?' (0x3000) at index 5"
)
Lib/test/test_sax.py
Dosyayı görüntüle @
d2bf3b7c
...
@@ -30,7 +30,7 @@ def confirm(outcome, name):
...
@@ -30,7 +30,7 @@ def confirm(outcome, name):
fails
=
fails
+
1
fails
=
fails
+
1
def
test_make_parser2
():
def
test_make_parser2
():
try
:
try
:
# Creating parsers several times in a row should succeed.
# Creating parsers several times in a row should succeed.
# Testing this because there have been failures of this kind
# Testing this because there have been failures of this kind
# before.
# before.
...
@@ -50,8 +50,8 @@ def test_make_parser2():
...
@@ -50,8 +50,8 @@ def test_make_parser2():
return
0
return
0
else
:
else
:
return
p
return
p
# ===========================================================================
# ===========================================================================
#
#
# saxutils tests
# saxutils tests
...
@@ -397,7 +397,7 @@ def test_expat_locator_noinfo():
...
@@ -397,7 +397,7 @@ def test_expat_locator_noinfo():
return
parser
.
getSystemId
()
is
None
and
\
return
parser
.
getSystemId
()
is
None
and
\
parser
.
getPublicId
()
is
None
and
\
parser
.
getPublicId
()
is
None
and
\
parser
.
getLineNumber
()
==
1
parser
.
getLineNumber
()
==
1
def
test_expat_locator_withinfo
():
def
test_expat_locator_withinfo
():
result
=
StringIO
()
result
=
StringIO
()
...
...
Lib/test/test_support.py
Dosyayı görüntüle @
d2bf3b7c
...
@@ -73,13 +73,13 @@ def findfile(file, here=__file__):
...
@@ -73,13 +73,13 @@ def findfile(file, here=__file__):
return
file
return
file
def
verify
(
condition
,
reason
=
'test failed'
):
def
verify
(
condition
,
reason
=
'test failed'
):
""" Verify that condition is true. If not, raise an
""" Verify that condition is true. If not, raise an
AssertionError.
AssertionError.
The optinal argument reason can be given to provide
The optinal argument reason can be given to provide
a better error text.
a better error text.
"""
"""
if
not
condition
:
if
not
condition
:
raise
AssertionError
,
reason
raise
AssertionError
,
reason
Lib/test/test_unicode.py
Dosyayı görüntüle @
d2bf3b7c
...
@@ -195,7 +195,7 @@ if 0:
...
@@ -195,7 +195,7 @@ if 0:
# Non surrogate above surrogate value, fixup required
# Non surrogate above surrogate value, fixup required
def
test_lecmp
(
s
,
s2
):
def
test_lecmp
(
s
,
s2
):
verify
(
s
<
s2
,
"comparison failed on
%
s <
%
s"
%
(
s
,
s2
))
verify
(
s
<
s2
,
"comparison failed on
%
s <
%
s"
%
(
s
,
s2
))
def
test_fixup
(
s
):
def
test_fixup
(
s
):
s2
=
u'
\ud800\udc01
'
s2
=
u'
\ud800\udc01
'
...
@@ -372,11 +372,11 @@ verify(u'\ud800\udc02'.encode('utf-8') == \
...
@@ -372,11 +372,11 @@ verify(u'\ud800\udc02'.encode('utf-8') == \
verify
(
u'
\ud84d\udc56
'
.
encode
(
'utf-8'
)
==
\
verify
(
u'
\ud84d\udc56
'
.
encode
(
'utf-8'
)
==
\
''
.
join
((
chr
(
0xf0
),
chr
(
0xa3
),
chr
(
0x91
),
chr
(
0x96
)))
)
''
.
join
((
chr
(
0xf0
),
chr
(
0xa3
),
chr
(
0x91
),
chr
(
0x96
)))
)
# UTF-8 specific decoding tests
# UTF-8 specific decoding tests
verify
(
unicode
(
''
.
join
((
chr
(
0xf0
),
chr
(
0xa3
),
chr
(
0x91
),
chr
(
0x96
))),
verify
(
unicode
(
''
.
join
((
chr
(
0xf0
),
chr
(
0xa3
),
chr
(
0x91
),
chr
(
0x96
))),
'utf-8'
)
==
u'
\ud84d\udc56
'
)
'utf-8'
)
==
u'
\ud84d\udc56
'
)
verify
(
unicode
(
''
.
join
((
chr
(
0xf0
),
chr
(
0x90
),
chr
(
0x80
),
chr
(
0x82
))),
verify
(
unicode
(
''
.
join
((
chr
(
0xf0
),
chr
(
0x90
),
chr
(
0x80
),
chr
(
0x82
))),
'utf-8'
)
==
u'
\ud800\udc02
'
)
'utf-8'
)
==
u'
\ud800\udc02
'
)
verify
(
unicode
(
''
.
join
((
chr
(
0xe2
),
chr
(
0x82
),
chr
(
0xac
))),
verify
(
unicode
(
''
.
join
((
chr
(
0xe2
),
chr
(
0x82
),
chr
(
0xac
))),
'utf-8'
)
==
u'
\u20ac
'
)
'utf-8'
)
==
u'
\u20ac
'
)
# Other possible utf-8 test cases:
# Other possible utf-8 test cases:
...
@@ -501,7 +501,7 @@ for encoding in (
...
@@ -501,7 +501,7 @@ for encoding in (
'cp852'
,
'cp855'
,
'cp860'
,
'cp861'
,
'cp862'
,
'cp852'
,
'cp855'
,
'cp860'
,
'cp861'
,
'cp862'
,
'cp863'
,
'cp865'
,
'cp866'
,
'cp863'
,
'cp865'
,
'cp866'
,
'iso8859_10'
,
'iso8859_13'
,
'iso8859_14'
,
'iso8859_15'
,
'iso8859_10'
,
'iso8859_13'
,
'iso8859_14'
,
'iso8859_15'
,
'iso8859_2'
,
'iso8859_4'
,
'iso8859_5'
,
'iso8859_2'
,
'iso8859_4'
,
'iso8859_5'
,
'iso8859_9'
,
'koi8_r'
,
'latin_1'
,
'iso8859_9'
,
'koi8_r'
,
'latin_1'
,
'mac_cyrillic'
,
'mac_latin2'
,
'mac_cyrillic'
,
'mac_latin2'
,
...
@@ -509,7 +509,7 @@ for encoding in (
...
@@ -509,7 +509,7 @@ for encoding in (
#'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255',
#'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255',
#'cp1256', 'cp1257', 'cp1258',
#'cp1256', 'cp1257', 'cp1258',
#'cp424', 'cp856', 'cp857', 'cp864', 'cp869', 'cp874',
#'cp424', 'cp856', 'cp857', 'cp864', 'cp869', 'cp874',
#'iso8859_3', 'iso8859_6', 'iso8859_7',
#'iso8859_3', 'iso8859_6', 'iso8859_7',
#'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish',
#'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish',
### These fail the round-trip:
### These fail the round-trip:
...
...
Lib/test/test_xreadline.py
Dosyayı görüntüle @
d2bf3b7c
from
test_support
import
verbose
from
test_support
import
verbose
class
XReader
:
class
XReader
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
count
=
5
self
.
count
=
5
def
readlines
(
self
,
sizehint
=
None
):
def
readlines
(
self
,
sizehint
=
None
):
self
.
count
=
self
.
count
-
1
self
.
count
=
self
.
count
-
1
return
map
(
lambda
x
:
"
%
d
\n
"
%
x
,
range
(
self
.
count
))
return
map
(
lambda
x
:
"
%
d
\n
"
%
x
,
range
(
self
.
count
))
class
Null
:
pass
class
Null
:
pass
...
@@ -16,28 +16,28 @@ import xreadlines
...
@@ -16,28 +16,28 @@ import xreadlines
lineno
=
0
lineno
=
0
try
:
try
:
xreadlines
.
xreadlines
(
Null
())[
0
]
xreadlines
.
xreadlines
(
Null
())[
0
]
except
AttributeError
,
detail
:
except
AttributeError
,
detail
:
print
"AttributeError (expected)"
print
"AttributeError (expected)"
else
:
else
:
print
"Did not throw attribute error"
print
"Did not throw attribute error"
try
:
try
:
xreadlines
.
xreadlines
(
XReader
)[
0
]
xreadlines
.
xreadlines
(
XReader
)[
0
]
except
TypeError
,
detail
:
except
TypeError
,
detail
:
print
"TypeError (expected)"
print
"TypeError (expected)"
else
:
else
:
print
"Did not throw type error"
print
"Did not throw type error"
try
:
try
:
xreadlines
.
xreadlines
(
XReader
())[
1
]
xreadlines
.
xreadlines
(
XReader
())[
1
]
except
RuntimeError
,
detail
:
except
RuntimeError
,
detail
:
print
"RuntimeError (expected):"
,
detail
print
"RuntimeError (expected):"
,
detail
else
:
else
:
print
"Did not throw runtime error"
print
"Did not throw runtime error"
xresult
=
[
'0
\n
'
,
'1
\n
'
,
'2
\n
'
,
'3
\n
'
,
'0
\n
'
,
'1
\n
'
,
'2
\n
'
,
'0
\n
'
,
'1
\n
'
,
'0
\n
'
]
xresult
=
[
'0
\n
'
,
'1
\n
'
,
'2
\n
'
,
'3
\n
'
,
'0
\n
'
,
'1
\n
'
,
'2
\n
'
,
'0
\n
'
,
'1
\n
'
,
'0
\n
'
]
for
line
in
xreadlines
.
xreadlines
(
XReader
()):
for
line
in
xreadlines
.
xreadlines
(
XReader
()):
if
line
!=
xresult
[
lineno
]:
if
line
!=
xresult
[
lineno
]:
print
"line
%
d differs"
%
lineno
print
"line
%
d differs"
%
lineno
lineno
+=
1
lineno
+=
1
Lib/test/testcodec.py
Dosyayı görüntüle @
d2bf3b7c
...
@@ -14,14 +14,14 @@ class Codec(codecs.Codec):
...
@@ -14,14 +14,14 @@ class Codec(codecs.Codec):
def
encode
(
self
,
input
,
errors
=
'strict'
):
def
encode
(
self
,
input
,
errors
=
'strict'
):
return
codecs
.
charmap_encode
(
input
,
errors
,
encoding_map
)
return
codecs
.
charmap_encode
(
input
,
errors
,
encoding_map
)
def
decode
(
self
,
input
,
errors
=
'strict'
):
def
decode
(
self
,
input
,
errors
=
'strict'
):
return
codecs
.
charmap_decode
(
input
,
errors
,
decoding_map
)
return
codecs
.
charmap_decode
(
input
,
errors
,
decoding_map
)
class
StreamWriter
(
Codec
,
codecs
.
StreamWriter
):
class
StreamWriter
(
Codec
,
codecs
.
StreamWriter
):
pass
pass
class
StreamReader
(
Codec
,
codecs
.
StreamReader
):
class
StreamReader
(
Codec
,
codecs
.
StreamReader
):
pass
pass
...
@@ -46,4 +46,3 @@ decoding_map.update({
...
@@ -46,4 +46,3 @@ decoding_map.update({
encoding_map
=
{}
encoding_map
=
{}
for
k
,
v
in
decoding_map
.
items
():
for
k
,
v
in
decoding_map
.
items
():
encoding_map
[
v
]
=
k
encoding_map
[
v
]
=
k
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