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
418e80ba
Kaydet (Commit)
418e80ba
authored
Ock 23, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Fixed test_user_command on OpenSolaris where floats can have different string
representation in Tcl and Python.
üst
fe5fff63
bdf0cb52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
test_tcl.py
Lib/test/test_tcl.py
+20
-9
No files found.
Lib/test/test_tcl.py
Dosyayı görüntüle @
418e80ba
...
...
@@ -199,9 +199,19 @@ class TclTest(unittest.TestCase):
result
=
arg
return
arg
self
.
interp
.
createcommand
(
'testfunc'
,
testfunc
)
def
check
(
value
,
expected
):
self
.
assertEqual
(
self
.
interp
.
call
(
'testfunc'
,
value
),
expected
)
self
.
assertEqual
(
result
,
expected
)
def
check
(
value
,
expected
,
eq
=
self
.
assertEqual
):
r
=
self
.
interp
.
call
(
'testfunc'
,
value
)
self
.
assertIsInstance
(
result
,
str
)
eq
(
result
,
expected
)
self
.
assertIsInstance
(
r
,
str
)
eq
(
r
,
expected
)
def
float_eq
(
actual
,
expected
):
expected
=
float
(
expected
)
self
.
assertAlmostEqual
(
float
(
actual
),
expected
,
delta
=
abs
(
expected
)
*
1e-10
)
def
nan_eq
(
actual
,
expected
):
actual
=
float
(
actual
)
self
.
assertNotEqual
(
actual
,
actual
)
check
(
True
,
'1'
)
check
(
False
,
'0'
)
...
...
@@ -210,13 +220,14 @@ class TclTest(unittest.TestCase):
check
(
'string
\u20ac
'
,
'string
\u20ac
'
)
for
i
in
(
0
,
1
,
-
1
,
2
**
31
-
1
,
-
2
**
31
):
check
(
i
,
str
(
i
))
for
f
in
(
0.0
,
1.0
,
-
1.0
,
1
/
3
,
sys
.
float_info
.
min
,
sys
.
float_info
.
max
,
for
f
in
(
0.0
,
1.0
,
-
1.0
):
check
(
f
,
repr
(
f
))
for
f
in
(
1
/
3.0
,
sys
.
float_info
.
min
,
sys
.
float_info
.
max
,
-
sys
.
float_info
.
min
,
-
sys
.
float_info
.
max
):
check
(
f
,
str
(
f
)
)
check
(
float
(
'
nan'
),
'NaN'
)
check
(
float
(
'inf'
),
'Inf'
)
check
(
-
float
(
'inf'
),
'-Inf'
)
check
(
f
,
f
,
eq
=
float_eq
)
check
(
float
(
'
inf'
),
'Inf'
,
eq
=
float_eq
)
check
(
-
float
(
'inf'
),
'-Inf'
,
eq
=
float_eq
)
check
(
float
(
'nan'
),
'NaN'
,
eq
=
nan_eq
)
check
((),
''
)
check
((
1
,
(
2
,),
(
3
,
4
),
'5 6'
,
()),
'1 2 {3 4} {5 6} {}'
)
...
...
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