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
fad65594
Kaydet (Commit)
fad65594
authored
May 18, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix test_locale for platforms without a default thousands separator.
üst
bbab671d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
test_locale.py
Lib/test/test_locale.py
+8
-5
No files found.
Lib/test/test_locale.py
Dosyayı görüntüle @
fad65594
...
...
@@ -52,23 +52,26 @@ try:
# === Test format() with more complex formatting strings
# test if grouping is independent from other characters in formatting string
testformat
(
"One million is
%
i"
,
1000000
,
grouping
=
1
,
output
=
'One million is 1,000,000'
,
testformat
(
"One million is
%
i"
,
1000000
,
grouping
=
1
,
output
=
'One million is 1
%
s000
%
s000'
%
(
sep
,
sep
),
func
=
locale
.
format_string
)
testformat
(
"One million is
%
i"
,
1000000
,
grouping
=
1
,
output
=
'One million is 1,000,000'
,
testformat
(
"One million is
%
i"
,
1000000
,
grouping
=
1
,
output
=
'One million is 1
%
s000
%
s000'
%
(
sep
,
sep
),
func
=
locale
.
format_string
)
# test dots in formatting string
testformat
(
".
%
f."
,
1000.0
,
output
=
'.1000.000000.'
,
func
=
locale
.
format_string
)
# test floats
testformat
(
"-->
%10.2
f"
,
1000.0
,
grouping
=
1
,
output
=
'--> 1
,000.00'
,
testformat
(
"-->
%10.2
f"
,
1000.0
,
grouping
=
1
,
output
=
'--> 1
%
s000.00'
%
sep
,
func
=
locale
.
format_string
)
# test asterisk formats
testformat
(
"
%10.*
f"
,
(
2
,
1000.0
),
grouping
=
0
,
output
=
' 1000.00'
,
func
=
locale
.
format_string
)
testformat
(
"
%*.*
f"
,
(
10
,
2
,
1000.0
),
grouping
=
1
,
output
=
' 1
,000.00'
,
testformat
(
"
%*.*
f"
,
(
10
,
2
,
1000.0
),
grouping
=
1
,
output
=
' 1
%
s000.00'
%
sep
,
func
=
locale
.
format_string
)
# test more-in-one
testformat
(
"int
%
i float
%.2
f str
%
s"
,
(
1000
,
1000.0
,
'str'
),
grouping
=
1
,
output
=
'int 1,000 float 1,000.00 str str'
,
func
=
locale
.
format_string
)
output
=
'int 1
%
s000 float 1
%
s000.00 str str'
%
(
sep
,
sep
),
func
=
locale
.
format_string
)
finally
:
locale
.
setlocale
(
locale
.
LC_NUMERIC
,
oldlocale
)
...
...
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