Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
zaide
BakuJS
Commits
e49b7594
Commit
e49b7594
authored
Jan 25, 2016
by
Zéfling
🎨
Browse files
Ajout de tests en erreur à corriger
parent
a0e3a65e
Changes
1
Hide whitespace changes
Inline
Side-by-side
test.js
View file @
e49b7594
...
...
@@ -145,11 +145,22 @@ window.onload = function(){
Test
.
equals
(
"
new Number(1).formatByPattern('#,###.00', {lg : 'fr'})
"
,
'
1,00
'
,
'
1 + #,###.000 → 1,00
'
);
Test
.
equals
(
"
new Number(1).formatByPattern('#,###.0', {lg : 'en'})
"
,
'
1.0
'
,
'
1 + #,### → 1.0
'
);
Test
.
equals
(
"
new Number(1).formatByPattern('#,###.00', {lg : 'en'})
"
,
'
1.00
'
,
'
1 + #,### → 1.00
'
);
Test
.
equals
(
"
new Number(1).formatByPattern('#,###.##', {lg : 'en'})
"
,
'
1
'
,
'
1 + #,### → 1
'
);
Test
.
equals
(
"
new Number(1.1).formatByPattern('#,###.##', {lg : 'en'})
"
,
'
1.1
'
,
'
1 + #,### → 1.1
'
);
Test
.
equals
(
"
new Number(1000 ).formatByPattern('#,###', {lg : 'fr'})
"
,
'
1
\
u00A0000
'
,
'
1000 + #,### → 1
\
u00A0000
'
);
Test
.
equals
(
"
new Number(1000000).formatByPattern('#,###', {lg : 'fr'})
"
,
'
1
\
u00A0000
\
u00A0000
'
,
'
1000000 + #,### → 1
\
u00A0000
\
u00A0000
'
);
Test
.
equals
(
"
new Number(1000 ).formatByPattern('#,####', {lg : 'fr'})
"
,
'
1000
'
,
'
1000 + #,### → 1000
'
);
Test
.
equals
(
"
new Number(1000000).formatByPattern('#,####', {lg : 'fr'})
"
,
'
100
\
u00A00000
'
,
'
1000000 + #,### → 100
\
u00A00000
'
);
Test
.
equals
(
"
new Number(123456789.987654321).formatByPattern('#,###.00', {lg : 'en'})
"
,
'
123,456,789.98
'
,
'
123456789.987654321 + #,###.00 → 123,456,789.98
'
);
Test
.
equals
(
"
new Number(123456789.987654321).formatByPattern('#,###.##', {lg : 'en'})
"
,
'
123,456,789.98
'
,
'
123456789.987654321 + #,###.## → 123,456,789.98
'
);
Test
.
equals
(
"
new Number(123.123).formatByPattern('0000.00', {lg : 'fr'})
"
,
'
0123,12
'
,
'
123.123 + #,### → 0123,12
'
);
Test
.
equals
(
"
new Number(123.123).formatByPattern('0000.0###', {lg : 'fr'})
"
,
'
0123,123
'
,
'
123.123 + #,### → 0123,123
'
);
Test
.
equals
(
"
new Number(123.123).formatByPattern('0000.0000', {lg : 'fr'})
"
,
'
0123,1230
'
,
'
123.123 + #,### → 0123,1230
'
);
Test
.
equals
(
"
new Number(123.103).formatByPattern('0000.##', {lg : 'fr'})
"
,
'
0123,1
'
,
'
123.103 + #,### → 0123,1
'
);
Test
.
equals
(
"
new Number(123.103).formatByPattern('#000.##', {lg : 'fr'})
"
,
'
123,1
'
,
'
123.103 + #,### → 123,1
'
);
Test
.
error
(
"
new Number(123.103).formatByPattern('0#000.##', {lg : 'fr'})
"
);
Test
.
error
(
"
new Number(123.103).formatByPattern('0000.#0', {lg : 'fr'})
"
);
Test
.
error
(
"
new Number(123.103).formatByPattern('0000.#0#', {lg : 'fr'})
"
);
Test
.
title
(
"
String.padLeft()
"
);
Test
.
equals
(
"
'1'.padLeft(1, '.')
"
,
'
1
'
,
"
1 + left(1, '') → 1
"
);
...
...
@@ -230,4 +241,4 @@ window.onload = function(){
Test
.
equals
(
"
'{0, date,
\\\\
w
\\\\
e
\\\\
e
\\\\
kw
\\\\\\\\
yyyy}'.format('2015-10-20')
"
,
'
week43
\\
2015
'
,
'
2015-10-20 + {0, date,
\\
w
\\
e
\\
e
\\
kw
\\\\
yyyy} → week43
\\
2015
'
);
Test
.
equals
(
"
'{0, date, {1}}'.format(['2015-10-20', 'dd/MM/yyyy'])
"
,
'
20/10/2015
'
,
'
[2015-10-20, dd/MM/yyyy] + {0, date, {1}} → 20/10/2015
'
);
}
\ No newline at end of file
}
Write
Preview
Supports
Markdown
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