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
a87b383a
Kaydet (Commit)
a87b383a
authored
Eyl 13, 2010
tarafından
Florent Xicluna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Reenable test_ucs4 and remove some duplicated lines.
üst
0f4dd9a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
27 deletions
+18
-27
string_tests.py
Lib/test/string_tests.py
+1
-1
test_unicode.py
Lib/test/test_unicode.py
+17
-26
No files found.
Lib/test/string_tests.py
Dosyayı görüntüle @
a87b383a
...
...
@@ -1131,7 +1131,7 @@ class MixinStrUnicodeUserStringTest:
format
=
'
%%
.
%
if'
%
prec
value
=
0.01
for
x
in
range
(
60
):
value
=
value
*
3.14159265
5
/
3.0
*
10.0
value
=
value
*
3.14159265
359
/
3.0
*
10.0
self
.
checkcall
(
format
,
"__mod__"
,
value
)
def
test_inplace_rewrites
(
self
):
...
...
Lib/test/test_unicode.py
Dosyayı görüntüle @
a87b383a
...
...
@@ -62,7 +62,7 @@ class UnicodeTest(string_tests.CommonTest,
self
.
assertRaises
(
SyntaxError
,
eval
,
'
\'\\
Uffffffff
\'
'
)
self
.
assertRaises
(
SyntaxError
,
eval
,
'
\'\\
U
%08
x
\'
'
%
0x110000
)
# raw strings should not have unicode escapes
self
.
assertNotEqual
s
(
r"\u0020"
,
" "
)
self
.
assertNotEqual
(
r"\u0020"
,
" "
)
def
test_ascii
(
self
):
if
not
sys
.
platform
.
startswith
(
'java'
):
...
...
@@ -286,13 +286,7 @@ class UnicodeTest(string_tests.CommonTest,
def
test_comparison
(
self
):
# Comparisons:
self
.
assertEqual
(
'abc'
,
'abc'
)
self
.
assertEqual
(
'abc'
,
'abc'
)
self
.
assertEqual
(
'abc'
,
'abc'
)
self
.
assertTrue
(
'abcd'
>
'abc'
)
self
.
assertTrue
(
'abcd'
>
'abc'
)
self
.
assertTrue
(
'abcd'
>
'abc'
)
self
.
assertTrue
(
'abc'
<
'abcd'
)
self
.
assertTrue
(
'abc'
<
'abcd'
)
self
.
assertTrue
(
'abc'
<
'abcd'
)
if
0
:
...
...
@@ -652,8 +646,6 @@ class UnicodeTest(string_tests.CommonTest,
self
.
assertRaises
(
IndexError
,
'{1}'
.
format
,
'abc'
)
self
.
assertRaises
(
KeyError
,
'{x}'
.
format
)
self
.
assertRaises
(
ValueError
,
"}{"
.
format
)
self
.
assertRaises
(
ValueError
,
"{"
.
format
)
self
.
assertRaises
(
ValueError
,
"}"
.
format
)
self
.
assertRaises
(
ValueError
,
"abc{0:{}"
.
format
)
self
.
assertRaises
(
ValueError
,
"{0"
.
format
)
self
.
assertRaises
(
IndexError
,
"{0.}"
.
format
)
...
...
@@ -1265,21 +1257,20 @@ class UnicodeTest(string_tests.CommonTest,
y
=
x
.
encode
(
"raw-unicode-escape"
)
.
decode
(
"raw-unicode-escape"
)
self
.
assertEqual
(
x
,
y
)
# FIXME
#y = r'\U00100000'
#x = y.encode("raw-unicode-escape").decode("raw-unicode-escape")
#self.assertEqual(x, y)
#y = r'\U00010000'
#x = y.encode("raw-unicode-escape").decode("raw-unicode-escape")
#self.assertEqual(x, y)
#try:
# '\U11111111'.decode("raw-unicode-escape")
#except UnicodeDecodeError as e:
# self.assertEqual(e.start, 0)
# self.assertEqual(e.end, 10)
#else:
# self.fail("Should have raised UnicodeDecodeError")
y
=
br
'
\U00100000
'
x
=
y
.
decode
(
"raw-unicode-escape"
)
.
encode
(
"raw-unicode-escape"
)
self
.
assertEqual
(
x
,
y
)
y
=
br
'
\U00010000
'
x
=
y
.
decode
(
"raw-unicode-escape"
)
.
encode
(
"raw-unicode-escape"
)
self
.
assertEqual
(
x
,
y
)
try
:
br
'
\U11111111
'
.
decode
(
"raw-unicode-escape"
)
except
UnicodeDecodeError
as
e
:
self
.
assertEqual
(
e
.
start
,
0
)
self
.
assertEqual
(
e
.
end
,
10
)
else
:
self
.
fail
(
"Should have raised UnicodeDecodeError"
)
def
test_conversion
(
self
):
# Make sure __unicode__() works properly
...
...
@@ -1382,8 +1373,8 @@ class UnicodeTest(string_tests.CommonTest,
def
__str__
(
self
):
return
'__str__ overridden'
s
=
S
(
'xxx'
)
self
.
assertEqual
s
(
"
%
s"
%
s
,
'__str__ overridden'
)
self
.
assertEqual
s
(
"{}"
.
format
(
s
),
'__str__ overridden'
)
self
.
assertEqual
(
"
%
s"
%
s
,
'__str__ overridden'
)
self
.
assertEqual
(
"{}"
.
format
(
s
),
'__str__ overridden'
)
def
test_from_format
(
self
):
# Ensure that PyUnicode_FromFormat() raises an error for a non-ascii
...
...
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