1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.javascript.host.intl;
16
17 import org.apache.commons.lang3.CharUtils;
18 import org.htmlunit.WebDriverTestCase;
19 import org.htmlunit.junit.annotation.Alerts;
20 import org.junit.jupiter.api.Test;
21 import org.opentest4j.AssertionFailedError;
22
23
24
25
26
27
28 public class NumberFormat2Test extends WebDriverTestCase {
29
30 private void test(final String... string) throws Exception {
31 final StringBuilder html = new StringBuilder(DOCTYPE_HTML
32 + "<html><head>\n"
33 + "<script>\n"
34 + LOG_TEXTAREA_FUNCTION
35 + " function test() {\n"
36 + " var number = 31415.9265359;\n"
37 + " try {\n");
38 for (int i = 0; i < string.length - 1; i++) {
39 html.append(string[i]).append("\n");
40 }
41 html.append(
42 " log(" + string[string.length - 1] + ");\n"
43 + " } catch(e) { logEx(e) }\n"
44 + " }\n"
45 + "</script>\n"
46 + "</head><body onload='test()'>\n"
47 + LOG_TEXTAREA
48 + "</body></html>");
49
50 try {
51 loadPageVerifyTextArea2(html.toString());
52 }
53 catch (final AssertionFailedError e) {
54 final String msg = e.getMessage();
55 for (int i = 0; i < msg.length(); i++) {
56 final char c = msg.charAt(i);
57 if (CharUtils.isAscii(c)) {
58 System.out.print(c);
59 }
60 else {
61 System.out.print(CharUtils.unicodeEscaped(c));
62 }
63 }
64 System.out.println();
65 throw e;
66 }
67 }
68
69
70
71
72 @Test
73 @Alerts("[object Intl]")
74 public void intl() throws Exception {
75 test("Intl");
76 }
77
78
79
80
81 @Test
82 @Alerts("0")
83 public void format_zero() throws Exception {
84 test("new Intl.NumberFormat('en').format(0)");
85 }
86
87
88
89
90 @Test
91 @Alerts("7")
92 public void format_int() throws Exception {
93 test("new Intl.NumberFormat('en').format(7)");
94 }
95
96
97
98
99 @Test
100 @Alerts("0.012")
101 public void format_zeroDot() throws Exception {
102 test("new Intl.NumberFormat('en').format(0.0123)");
103 }
104
105
106
107
108 @Test
109 @Alerts("31,415.927")
110 public void format_default() throws Exception {
111 test("new Intl.NumberFormat().format(number)");
112 }
113
114
115
116
117 @Test
118 @Alerts("31,415.927")
119 public void format_ja_jp_u_ca_japanese() throws Exception {
120 test("new Intl.NumberFormat('ja-JP-u-ca-japanese').format(number)");
121 }
122
123
124
125
126
127
128 @Test
129 @Alerts("31,415.927")
130 public void format_ban() throws Exception {
131 test("new Intl.NumberFormat('ban').format(number)");
132 }
133
134
135
136
137 @Test
138 @Alerts("31.415,927")
139 public void format_id() throws Exception {
140 test("new Intl.NumberFormat('id').format(number)");
141 }
142
143
144
145
146
147
148 @Test
149 @Alerts("31.415,927")
150 public void format_ban_id() throws Exception {
151 test("new Intl.NumberFormat(['ban', 'id']).format(number)");
152 }
153
154
155
156
157 @Test
158 @Alerts("31,415.927")
159 public void format_ar() throws Exception {
160 test("new Intl.NumberFormat('ar').format(number)");
161 }
162
163
164
165
166 @Test
167 @Alerts("31,415.927")
168 public void format_ar_ae() throws Exception {
169 test("new Intl.NumberFormat('ar-AE').format(number)");
170 }
171
172
173
174
175 @Test
176 @Alerts("\u0663\u0661\u066c\u0664\u0661\u0665\u066b\u0669\u0662\u0667")
177 public void format_ar_bh() throws Exception {
178 test("new Intl.NumberFormat('ar-BH').format(number)");
179 }
180
181
182
183
184 @Test
185 @Alerts("31.415,927")
186 public void format_ar_dz() throws Exception {
187 test("new Intl.NumberFormat('ar-DZ').format(number)");
188 }
189
190
191
192
193 @Test
194 @Alerts("\u0663\u0661\u066c\u0664\u0661\u0665\u066b\u0669\u0662\u0667")
195 public void format_ar_eg() throws Exception {
196 test("new Intl.NumberFormat('ar-EG').format(number)");
197 }
198
199
200
201
202 @Test
203 @Alerts("\u0663\u0661\u066c\u0664\u0661\u0665\u066b\u0669\u0662\u0667")
204 public void format_ar_iq() throws Exception {
205 test("new Intl.NumberFormat('ar-IQ').format(number)");
206 }
207
208
209
210
211 @Test
212 @Alerts("\u0663\u0661\u066c\u0664\u0661\u0665\u066b\u0669\u0662\u0667")
213 public void format_ar_jo() throws Exception {
214 test("new Intl.NumberFormat('ar-JO').format(number)");
215 }
216
217
218
219
220 @Test
221 @Alerts("\u0663\u0661\u066c\u0664\u0661\u0665\u066b\u0669\u0662\u0667")
222 public void format_ar_kw() throws Exception {
223 test("new Intl.NumberFormat('ar-KW').format(number)");
224 }
225
226
227
228
229 @Test
230 @Alerts("\u0663\u0661\u066c\u0664\u0661\u0665\u066b\u0669\u0662\u0667")
231 public void format_ar_lb() throws Exception {
232 test("new Intl.NumberFormat('ar-LB').format(number)");
233 }
234
235
236
237
238 @Test
239 @Alerts("31.415,927")
240 public void format_ar_ly() throws Exception {
241 test("new Intl.NumberFormat('ar-LY').format(number)");
242 }
243
244
245
246
247 @Test
248 @Alerts("31.415,927")
249 public void format_ar_ma() throws Exception {
250 test("new Intl.NumberFormat('ar-MA').format(number)");
251 }
252
253
254
255
256 @Test
257 @Alerts("\u0663\u0661\u066c\u0664\u0661\u0665\u066b\u0669\u0662\u0667")
258 public void format_ar_om() throws Exception {
259 test("new Intl.NumberFormat('ar-OM').format(number)");
260 }
261
262
263
264
265 @Test
266 @Alerts("\u0663\u0661\u066c\u0664\u0661\u0665\u066b\u0669\u0662\u0667")
267 public void format_ar_qa() throws Exception {
268 test("new Intl.NumberFormat('ar-QA').format(number)");
269 }
270
271
272
273
274 @Test
275 @Alerts("\u0663\u0661\u066c\u0664\u0661\u0665\u066b\u0669\u0662\u0667")
276 public void format_ar_sa() throws Exception {
277 test("new Intl.NumberFormat('ar-SA').format(number)");
278 }
279
280
281
282
283 @Test
284 @Alerts("\u0663\u0661\u066c\u0664\u0661\u0665\u066b\u0669\u0662\u0667")
285 public void format_ar_sd() throws Exception {
286 test("new Intl.NumberFormat('ar-SD').format(number)");
287 }
288
289
290
291
292 @Test
293 @Alerts("\u0663\u0661\u066c\u0664\u0661\u0665\u066b\u0669\u0662\u0667")
294 public void format_ar_sy() throws Exception {
295 test("new Intl.NumberFormat('ar-SY').format(number)");
296 }
297
298
299
300
301 @Test
302 @Alerts("31.415,927")
303 public void format_ar_tn() throws Exception {
304 test("new Intl.NumberFormat('ar-TN').format(number)");
305 }
306
307
308
309
310 @Test
311 @Alerts("\u0663\u0661\u066c\u0664\u0661\u0665\u066b\u0669\u0662\u0667")
312 public void format_ar_ye() throws Exception {
313 test("new Intl.NumberFormat('ar-YE').format(number)");
314 }
315
316
317
318
319 @Test
320 @Alerts(DEFAULT = "31,415.927",
321 FF = "31\u00a0415,927",
322 FF_ESR = "31\u00a0415,927")
323 public void format_be() throws Exception {
324 test("new Intl.NumberFormat('be').format(number)");
325 }
326
327
328
329
330 @Test
331 @Alerts(DEFAULT = "31,415.927",
332 FF = "31\u00a0415,927",
333 FF_ESR = "31\u00a0415,927")
334 public void format_be_by() throws Exception {
335 test("new Intl.NumberFormat('be-BY').format(number)");
336 }
337
338
339
340
341 @Test
342 @Alerts("31\u00a0415,927")
343 public void format_bg() throws Exception {
344 test("new Intl.NumberFormat('bg').format(number)");
345 }
346
347
348
349
350 @Test
351 @Alerts("31\u00a0415,927")
352 public void format_bg_bg() throws Exception {
353 test("new Intl.NumberFormat('bg-BG').format(number)");
354 }
355
356
357
358
359 @Test
360 @Alerts("31.415,927")
361 public void format_ca() throws Exception {
362 test("new Intl.NumberFormat('ca').format(number)");
363 }
364
365
366
367
368 @Test
369 @Alerts("31.415,927")
370 public void format_ca_es() throws Exception {
371 test("new Intl.NumberFormat('ca-ES').format(number)");
372 }
373
374
375
376
377 @Test
378 @Alerts("31\u00a0415,927")
379 public void format_cs() throws Exception {
380 test("new Intl.NumberFormat('cs').format(number)");
381 }
382
383
384
385
386 @Test
387 @Alerts("31\u00a0415,927")
388 public void format_cs_cz() throws Exception {
389 test("new Intl.NumberFormat('cs-CZ').format(number)");
390 }
391
392
393
394
395 @Test
396 @Alerts("31.415,927")
397 public void format_da() throws Exception {
398 test("new Intl.NumberFormat('da').format(number)");
399 }
400
401
402
403
404 @Test
405 @Alerts("31.415,927")
406 public void format_da_dk() throws Exception {
407 test("new Intl.NumberFormat('da-DK').format(number)");
408 }
409
410
411
412
413 @Test
414 @Alerts("31.415,927")
415 public void format_de() throws Exception {
416 test("new Intl.NumberFormat('de').format(number)");
417 }
418
419
420
421
422 @Test
423 @Alerts("31\u00a0415,927")
424 public void format_de_at() throws Exception {
425 test("new Intl.NumberFormat('de-AT').format(number)");
426 }
427
428
429
430
431 @Test
432 @Alerts("31\u2019415.927")
433 public void format_de_ch() throws Exception {
434 test("new Intl.NumberFormat('de-CH').format(number)");
435 }
436
437
438
439
440 @Test
441 @Alerts("31.415,927")
442 public void format_de_de() throws Exception {
443 test("new Intl.NumberFormat('de-DE').format(number)");
444 }
445
446
447
448
449 @Test
450 @Alerts("31.415,927")
451 public void format_de_lu() throws Exception {
452 test("new Intl.NumberFormat('de-LU').format(number)");
453 }
454
455
456
457
458 @Test
459 @Alerts("31.415,927")
460 public void format_el() throws Exception {
461 test("new Intl.NumberFormat('el').format(number)");
462 }
463
464
465
466
467 @Test
468 @Alerts("31.415,927")
469 public void format_el_cy() throws Exception {
470 test("new Intl.NumberFormat('el-CY').format(number)");
471 }
472
473
474
475
476 @Test
477 @Alerts("31.415,927")
478 public void format_el_gr() throws Exception {
479 test("new Intl.NumberFormat('el-GR').format(number)");
480 }
481
482
483
484
485 @Test
486 @Alerts("31,415.927")
487 public void format_en() throws Exception {
488 test("new Intl.NumberFormat('en').format(number)");
489 }
490
491
492
493
494 @Test
495 @Alerts("31,415.927")
496 public void format_en_au() throws Exception {
497 test("new Intl.NumberFormat('en-AU').format(number)");
498 }
499
500
501
502
503 @Test
504 @Alerts("31,415.927")
505 public void format_en_ca() throws Exception {
506 test("new Intl.NumberFormat('en-CA').format(number)");
507 }
508
509
510
511
512 @Test
513 @Alerts("31,415.927")
514 public void format_en_gb() throws Exception {
515 test("new Intl.NumberFormat('en-GB').format(number)");
516 }
517
518
519
520
521 @Test
522 @Alerts("31,415.927")
523 public void format_en_ie() throws Exception {
524 test("new Intl.NumberFormat('en-IE').format(number)");
525 }
526
527
528
529
530 @Test
531 @Alerts("31,415.927")
532 public void format_en_in() throws Exception {
533 test("new Intl.NumberFormat('en-IN').format(number)");
534 }
535
536
537
538
539 @Test
540 @Alerts("31,415.927")
541 public void format_en_mt() throws Exception {
542 test("new Intl.NumberFormat('en-MT').format(number)");
543 }
544
545
546
547
548 @Test
549 @Alerts("31,415.927")
550 public void format_en_nz() throws Exception {
551 test("new Intl.NumberFormat('en-NZ').format(number)");
552 }
553
554
555
556
557 @Test
558 @Alerts("31,415.927")
559 public void format_en_ph() throws Exception {
560 test("new Intl.NumberFormat('en-PH').format(number)");
561 }
562
563
564
565
566 @Test
567 @Alerts("31,415.927")
568 public void format_en_sg() throws Exception {
569 test("new Intl.NumberFormat('en-SG').format(number)");
570 }
571
572
573
574
575 @Test
576 @Alerts("31,415.927")
577 public void format_en_us() throws Exception {
578 test("new Intl.NumberFormat('en-US').format(number)");
579 }
580
581
582
583
584 @Test
585 @Alerts("31\u00a0415,927")
586 public void format_en_za() throws Exception {
587 test("new Intl.NumberFormat('en-ZA').format(number)");
588 }
589
590
591
592
593 @Test
594 @Alerts("31.415,927")
595 public void format_es() throws Exception {
596 test("new Intl.NumberFormat('es').format(number)");
597 }
598
599
600
601
602 @Test
603 @Alerts("31.415,927")
604 public void format_es_ar() throws Exception {
605 test("new Intl.NumberFormat('es-AR').format(number)");
606 }
607
608
609
610
611 @Test
612 @Alerts("31.415,927")
613 public void format_es_bo() throws Exception {
614 test("new Intl.NumberFormat('es-BO').format(number)");
615 }
616
617
618
619
620 @Test
621 @Alerts("31.415,927")
622 public void format_es_cl() throws Exception {
623 test("new Intl.NumberFormat('es-CL').format(number)");
624 }
625
626
627
628
629 @Test
630 @Alerts("31.415,927")
631 public void format_es_co() throws Exception {
632 test("new Intl.NumberFormat('es-CO').format(number)");
633 }
634
635
636
637
638 @Test
639 @Alerts("31\u00a0415,927")
640 public void format_es_cr() throws Exception {
641 test("new Intl.NumberFormat('es-CR').format(number)");
642 }
643
644
645
646
647 @Test
648 @Alerts("31,415.927")
649 public void format_es_do() throws Exception {
650 test("new Intl.NumberFormat('es-DO').format(number)");
651 }
652
653
654
655
656 @Test
657 @Alerts("31.415,927")
658 public void format_es_ec() throws Exception {
659 test("new Intl.NumberFormat('es-EC').format(number)");
660 }
661
662
663
664
665 @Test
666 @Alerts("31.415,927")
667 public void format_es_es() throws Exception {
668 test("new Intl.NumberFormat('es-ES').format(number)");
669 }
670
671
672
673
674 @Test
675 @Alerts("31,415.927")
676 public void format_es_gt() throws Exception {
677 test("new Intl.NumberFormat('es-GT').format(number)");
678 }
679
680
681
682
683 @Test
684 @Alerts("31,415.927")
685 public void format_es_hn() throws Exception {
686 test("new Intl.NumberFormat('es-HN').format(number)");
687 }
688
689
690
691
692 @Test
693 @Alerts("31,415.927")
694 public void format_es_mx() throws Exception {
695 test("new Intl.NumberFormat('es-MX').format(number)");
696 }
697
698
699
700
701 @Test
702 @Alerts("31,415.927")
703 public void format_es_ni() throws Exception {
704 test("new Intl.NumberFormat('es-NI').format(number)");
705 }
706
707
708
709
710 @Test
711 @Alerts("31,415.927")
712 public void format_es_pa() throws Exception {
713 test("new Intl.NumberFormat('es-PA').format(number)");
714 }
715
716
717
718
719 @Test
720 @Alerts("31,415.927")
721 public void format_es_pe() throws Exception {
722 test("new Intl.NumberFormat('es-PE').format(number)");
723 }
724
725
726
727
728 @Test
729 @Alerts("31,415.927")
730 public void format_es_pr() throws Exception {
731 test("new Intl.NumberFormat('es-PR').format(number)");
732 }
733
734
735
736
737 @Test
738 @Alerts("31.415,927")
739 public void format_es_py() throws Exception {
740 test("new Intl.NumberFormat('es-PY').format(number)");
741 }
742
743
744
745
746 @Test
747 @Alerts("31,415.927")
748 public void format_es_sv() throws Exception {
749 test("new Intl.NumberFormat('es-SV').format(number)");
750 }
751
752
753
754
755 @Test
756 @Alerts("31,415.927")
757 public void format_es_us() throws Exception {
758 test("new Intl.NumberFormat('es-US').format(number)");
759 }
760
761
762
763
764 @Test
765 @Alerts("31.415,927")
766 public void format_es_uy() throws Exception {
767 test("new Intl.NumberFormat('es-UY').format(number)");
768 }
769
770
771
772
773 @Test
774 @Alerts("31.415,927")
775 public void format_es_ve() throws Exception {
776 test("new Intl.NumberFormat('es-VE').format(number)");
777 }
778
779
780
781
782 @Test
783 @Alerts("31\u00a0415,927")
784 public void format_et() throws Exception {
785 test("new Intl.NumberFormat('et').format(number)");
786 }
787
788
789
790
791 @Test
792 @Alerts("31\u00a0415,927")
793 public void format_et_ee() throws Exception {
794 test("new Intl.NumberFormat('et-EE').format(number)");
795 }
796
797
798
799
800 @Test
801 @Alerts("31\u00a0415,927")
802 public void format_fi() throws Exception {
803 test("new Intl.NumberFormat('fi').format(number)");
804 }
805
806
807
808
809 @Test
810 @Alerts("31\u00a0415,927")
811 public void format_fi_fi() throws Exception {
812 test("new Intl.NumberFormat('fi-FI').format(number)");
813 }
814
815
816
817
818 @Test
819 @Alerts("31\u202f415,927")
820 public void format_fr() throws Exception {
821 test("new Intl.NumberFormat('fr').format(number)");
822 }
823
824
825
826
827 @Test
828 @Alerts("31\u202f415,927")
829 public void format_fr_be() throws Exception {
830 test("new Intl.NumberFormat('fr-BE').format(number)");
831 }
832
833
834
835
836 @Test
837 @Alerts("31\u00a0415,927")
838 public void format_fr_ca() throws Exception {
839 test("new Intl.NumberFormat('fr-CA').format(number)");
840 }
841
842
843
844
845 @Test
846 @Alerts("31\u202f415,927")
847 public void format_fr_ch() throws Exception {
848 test("new Intl.NumberFormat('fr-CH').format(number)");
849 }
850
851
852
853
854 @Test
855 @Alerts("31\u202f415,927")
856 public void format_fr_fr() throws Exception {
857 test("new Intl.NumberFormat('fr-FR').format(number)");
858 }
859
860
861
862
863 @Test
864 @Alerts("31.415,927")
865 public void format_fr_lu() throws Exception {
866 test("new Intl.NumberFormat('fr-LU').format(number)");
867 }
868
869
870
871
872 @Test
873 @Alerts("31,415.927")
874 public void format_ga() throws Exception {
875 test("new Intl.NumberFormat('ga').format(number)");
876 }
877
878
879
880
881 @Test
882 @Alerts("31,415.927")
883 public void format_ga_ie() throws Exception {
884 test("new Intl.NumberFormat('ga-IE').format(number)");
885 }
886
887
888
889
890 @Test
891 @Alerts("31,415.927")
892 public void format_hi_in() throws Exception {
893 test("new Intl.NumberFormat('hi-IN').format(number)");
894 }
895
896
897
898
899 @Test
900 @Alerts("31.415,927")
901 public void format_hr() throws Exception {
902 test("new Intl.NumberFormat('hr').format(number)");
903 }
904
905
906
907
908 @Test
909 @Alerts("31.415,927")
910 public void format_hr_hr() throws Exception {
911 test("new Intl.NumberFormat('hr-HR').format(number)");
912 }
913
914
915
916
917 @Test
918 @Alerts("31\u00a0415,927")
919 public void format_hu() throws Exception {
920 test("new Intl.NumberFormat('hu').format(number)");
921 }
922
923
924
925
926 @Test
927 @Alerts("31\u00a0415,927")
928 public void format_hu_hu() throws Exception {
929 test("new Intl.NumberFormat('hu-HU').format(number)");
930 }
931
932
933
934
935 @Test
936 @Alerts("31.415,927")
937 public void format_in() throws Exception {
938 test("new Intl.NumberFormat('in').format(number)");
939 }
940
941
942
943
944 @Test
945 @Alerts("31.415,927")
946 public void format_in_id() throws Exception {
947 test("new Intl.NumberFormat('in-ID').format(number)");
948 }
949
950
951
952
953 @Test
954 @Alerts(DEFAULT = "31,415.927",
955 FF = "31.415,927",
956 FF_ESR = "31.415,927")
957 public void format_is() throws Exception {
958 test("new Intl.NumberFormat('is').format(number)");
959 }
960
961
962
963
964 @Test
965 @Alerts(DEFAULT = "31,415.927",
966 FF = "31.415,927",
967 FF_ESR = "31.415,927")
968 public void format_is_is() throws Exception {
969 test("new Intl.NumberFormat('is-IS').format(number)");
970 }
971
972
973
974
975 @Test
976 @Alerts("31.415,927")
977 public void format_it() throws Exception {
978 test("new Intl.NumberFormat('it').format(number)");
979 }
980
981
982
983
984 @Test
985 @Alerts("31\u2019415.927")
986 public void format_it_ch() throws Exception {
987 test("new Intl.NumberFormat('it-CH').format(number)");
988 }
989
990
991
992
993 @Test
994 @Alerts("31.415,927")
995 public void format_it_it() throws Exception {
996 test("new Intl.NumberFormat('it-IT').format(number)");
997 }
998
999
1000
1001
1002 @Test
1003 @Alerts("31,415.927")
1004 public void format_iw() throws Exception {
1005 test("new Intl.NumberFormat('iw').format(number)");
1006 }
1007
1008
1009
1010
1011 @Test
1012 @Alerts("31,415.927")
1013 public void format_iw_il() throws Exception {
1014 test("new Intl.NumberFormat('iw-IL').format(number)");
1015 }
1016
1017
1018
1019
1020 @Test
1021 @Alerts("31,415.927")
1022 public void format_ja() throws Exception {
1023 test("new Intl.NumberFormat('ja').format(number)");
1024 }
1025
1026
1027
1028
1029 @Test
1030 @Alerts("31,415.927")
1031 public void format_ja_jp() throws Exception {
1032 test("new Intl.NumberFormat('ja-JP').format(number)");
1033 }
1034
1035
1036
1037
1038 @Test
1039 @Alerts("31,415.927")
1040 public void format_ko() throws Exception {
1041 test("new Intl.NumberFormat('ko').format(number)");
1042 }
1043
1044
1045
1046
1047 @Test
1048 @Alerts("31,415.927")
1049 public void format_ko_kr() throws Exception {
1050 test("new Intl.NumberFormat('ko-KR').format(number)");
1051 }
1052
1053
1054
1055
1056 @Test
1057 @Alerts("31\u00a0415,927")
1058 public void format_lt() throws Exception {
1059 test("new Intl.NumberFormat('lt').format(number)");
1060 }
1061
1062
1063
1064
1065 @Test
1066 @Alerts("31\u00a0415,927")
1067 public void format_lt_lt() throws Exception {
1068 test("new Intl.NumberFormat('lt-LT').format(number)");
1069 }
1070
1071
1072
1073
1074 @Test
1075 @Alerts("31\u00a0415,927")
1076 public void format_lv() throws Exception {
1077 test("new Intl.NumberFormat('lv').format(number)");
1078 }
1079
1080
1081
1082
1083 @Test
1084 @Alerts("31\u00a0415,927")
1085 public void format_lv_lv() throws Exception {
1086 test("new Intl.NumberFormat('lv-LV').format(number)");
1087 }
1088
1089
1090
1091
1092 @Test
1093 @Alerts(DEFAULT = "31,415.927",
1094 FF = "31.415,927",
1095 FF_ESR = "31.415,927")
1096 public void format_mk() throws Exception {
1097 test("new Intl.NumberFormat('mk').format(number)");
1098 }
1099
1100
1101
1102
1103 @Test
1104 @Alerts(DEFAULT = "31,415.927",
1105 FF = "31.415,927",
1106 FF_ESR = "31.415,927")
1107 public void format_mk_mk() throws Exception {
1108 test("new Intl.NumberFormat('mk-MK').format(number)");
1109 }
1110
1111
1112
1113
1114 @Test
1115 @Alerts("31,415.927")
1116 public void format_ms() throws Exception {
1117 test("new Intl.NumberFormat('ms').format(number)");
1118 }
1119
1120
1121
1122
1123 @Test
1124 @Alerts("31,415.927")
1125 public void format_ms_my() throws Exception {
1126 test("new Intl.NumberFormat('ms-MY').format(number)");
1127 }
1128
1129
1130
1131
1132 @Test
1133 @Alerts("31,415.927")
1134 public void format_mt() throws Exception {
1135 test("new Intl.NumberFormat('mt').format(number)");
1136 }
1137
1138
1139
1140
1141 @Test
1142 @Alerts("31,415.927")
1143 public void format_mt_mt() throws Exception {
1144 test("new Intl.NumberFormat('mt-MT').format(number)");
1145 }
1146
1147
1148
1149
1150 @Test
1151 @Alerts("31.415,927")
1152 public void format_nl() throws Exception {
1153 test("new Intl.NumberFormat('nl').format(number)");
1154 }
1155
1156
1157
1158
1159 @Test
1160 @Alerts("31.415,927")
1161 public void format_nl_be() throws Exception {
1162 test("new Intl.NumberFormat('nl-BE').format(number)");
1163 }
1164
1165
1166
1167
1168 @Test
1169 @Alerts("31.415,927")
1170 public void format_nl_nl() throws Exception {
1171 test("new Intl.NumberFormat('nl-NL').format(number)");
1172 }
1173
1174
1175
1176
1177 @Test
1178 @Alerts("31\u00a0415,927")
1179 public void format_no() throws Exception {
1180 test("new Intl.NumberFormat('no').format(number)");
1181 }
1182
1183
1184
1185
1186 @Test
1187 @Alerts("31\u00a0415,927")
1188 public void format_no_no() throws Exception {
1189 test("new Intl.NumberFormat('no-NO').format(number)");
1190 }
1191
1192
1193
1194
1195 @Test
1196 @Alerts("RangeError")
1197 public void format_no_no_ny() throws Exception {
1198 test("new Intl.NumberFormat('no-NO-NY').format(number)");
1199 }
1200
1201
1202
1203
1204 @Test
1205 @Alerts("31\u00a0415,927")
1206 public void format_pl() throws Exception {
1207 test("new Intl.NumberFormat('pl').format(number)");
1208 }
1209
1210
1211
1212
1213 @Test
1214 @Alerts("31\u00a0415,927")
1215 public void format_pl_pl() throws Exception {
1216 test("new Intl.NumberFormat('pl-PL').format(number)");
1217 }
1218
1219
1220
1221
1222 @Test
1223 @Alerts("31.415,927")
1224 public void format_pt() throws Exception {
1225 test("new Intl.NumberFormat('pt').format(number)");
1226 }
1227
1228
1229
1230
1231 @Test
1232 @Alerts("31.415,927")
1233 public void format_pt_br() throws Exception {
1234 test("new Intl.NumberFormat('pt-BR').format(number)");
1235 }
1236
1237
1238
1239
1240 @Test
1241 @Alerts("31\u00a0415,927")
1242 public void format_pt_pt() throws Exception {
1243 test("new Intl.NumberFormat('pt-PT').format(number)");
1244 }
1245
1246
1247
1248
1249 @Test
1250 @Alerts("31.415,927")
1251 public void format_ro() throws Exception {
1252 test("new Intl.NumberFormat('ro').format(number)");
1253 }
1254
1255
1256
1257
1258 @Test
1259 @Alerts("31.415,927")
1260 public void format_ro_ro() throws Exception {
1261 test("new Intl.NumberFormat('ro-RO').format(number)");
1262 }
1263
1264
1265
1266
1267 @Test
1268 @Alerts("31\u00a0415,927")
1269 public void format_ru() throws Exception {
1270 test("new Intl.NumberFormat('ru').format(number)");
1271 }
1272
1273
1274
1275
1276 @Test
1277 @Alerts("31\u00a0415,927")
1278 public void format_ru_ru() throws Exception {
1279 test("new Intl.NumberFormat('ru-RU').format(number)");
1280 }
1281
1282
1283
1284
1285 @Test
1286 @Alerts("31\u00a0415,927")
1287 public void format_sk() throws Exception {
1288 test("new Intl.NumberFormat('sk').format(number)");
1289 }
1290
1291
1292
1293
1294 @Test
1295 @Alerts("31\u00a0415,927")
1296 public void format_sk_sk() throws Exception {
1297 test("new Intl.NumberFormat('sk-SK').format(number)");
1298 }
1299
1300
1301
1302
1303 @Test
1304 @Alerts("31.415,927")
1305 public void format_sl() throws Exception {
1306 test("new Intl.NumberFormat('sl').format(number)");
1307 }
1308
1309
1310
1311
1312 @Test
1313 @Alerts("31.415,927")
1314 public void format_sl_si() throws Exception {
1315 test("new Intl.NumberFormat('sl-SI').format(number)");
1316 }
1317
1318
1319
1320
1321 @Test
1322 @Alerts(DEFAULT = "31,415.927",
1323 EDGE = "31\u00a0415,927",
1324 FF = "31\u00a0415,927",
1325 FF_ESR = "31\u00a0415,927")
1326 public void format_sq() throws Exception {
1327 test("new Intl.NumberFormat('sq').format(number)");
1328 }
1329
1330
1331
1332
1333 @Test
1334 @Alerts(DEFAULT = "31,415.927",
1335 EDGE = "31\u00a0415,927",
1336 FF = "31\u00a0415,927",
1337 FF_ESR = "31\u00a0415,927")
1338 public void format_sq_al() throws Exception {
1339 test("new Intl.NumberFormat('sq-AL').format(number)");
1340 }
1341
1342
1343
1344
1345 @Test
1346 @Alerts("31.415,927")
1347 public void format_sr() throws Exception {
1348 test("new Intl.NumberFormat('sr').format(number)");
1349 }
1350
1351
1352
1353
1354 @Test
1355 @Alerts("31.415,927")
1356 public void format_sr_ba() throws Exception {
1357 test("new Intl.NumberFormat('sr-BA').format(number)");
1358 }
1359
1360
1361
1362
1363 @Test
1364 @Alerts("31.415,927")
1365 public void format_sr_cs() throws Exception {
1366 test("new Intl.NumberFormat('sr-CS').format(number)");
1367 }
1368
1369
1370
1371
1372 @Test
1373 @Alerts("31.415,927")
1374 public void format_sr_me() throws Exception {
1375 test("new Intl.NumberFormat('sr-ME').format(number)");
1376 }
1377
1378
1379
1380
1381 @Test
1382 @Alerts("31.415,927")
1383 public void format_sr_rs() throws Exception {
1384 test("new Intl.NumberFormat('sr-RS').format(number)");
1385 }
1386
1387
1388
1389
1390 @Test
1391 @Alerts("31\u00a0415,927")
1392 public void format_sv() throws Exception {
1393 test("new Intl.NumberFormat('sv').format(number)");
1394 }
1395
1396
1397
1398
1399 @Test
1400 @Alerts("31\u00a0415,927")
1401 public void format_sv_se() throws Exception {
1402 test("new Intl.NumberFormat('sv-SE').format(number)");
1403 }
1404
1405
1406
1407
1408 @Test
1409 @Alerts("31,415.927")
1410 public void format_th() throws Exception {
1411 test("new Intl.NumberFormat('th').format(number)");
1412 }
1413
1414
1415
1416
1417 @Test
1418 @Alerts("31,415.927")
1419 public void format_th_th() throws Exception {
1420 test("new Intl.NumberFormat('th-TH').format(number)");
1421 }
1422
1423
1424
1425
1426 @Test
1427 @Alerts("31.415,927")
1428 public void format_tr() throws Exception {
1429 test("new Intl.NumberFormat('tr').format(number)");
1430 }
1431
1432
1433
1434
1435 @Test
1436 @Alerts("31.415,927")
1437 public void format_tr_tr() throws Exception {
1438 test("new Intl.NumberFormat('tr-TR').format(number)");
1439 }
1440
1441
1442
1443
1444 @Test
1445 @Alerts("31\u00a0415,927")
1446 public void format_uk() throws Exception {
1447 test("new Intl.NumberFormat('uk').format(number)");
1448 }
1449
1450
1451
1452
1453 @Test
1454 @Alerts("31\u00a0415,927")
1455 public void format_uk_ua() throws Exception {
1456 test("new Intl.NumberFormat('uk-UA').format(number)");
1457 }
1458
1459
1460
1461
1462 @Test
1463 @Alerts("31.415,927")
1464 public void format_vi() throws Exception {
1465 test("new Intl.NumberFormat('vi').format(number)");
1466 }
1467
1468
1469
1470
1471 @Test
1472 @Alerts("31.415,927")
1473 public void format_vi_vn() throws Exception {
1474 test("new Intl.NumberFormat('vi-VN').format(number)");
1475 }
1476
1477
1478
1479
1480 @Test
1481 @Alerts("31,415.927")
1482 public void format_zh() throws Exception {
1483 test("new Intl.NumberFormat('zh').format(number)");
1484 }
1485
1486
1487
1488
1489 @Test
1490 @Alerts("31,415.927")
1491 public void format_zh_cn() throws Exception {
1492 test("new Intl.NumberFormat('zh-CN').format(number)");
1493 }
1494
1495
1496
1497
1498 @Test
1499 @Alerts("31,415.927")
1500 public void format_zh_hk() throws Exception {
1501 test("new Intl.NumberFormat('zh-HK').format(number)");
1502 }
1503
1504
1505
1506
1507 @Test
1508 @Alerts("31,415.927")
1509 public void format_zh_sg() throws Exception {
1510 test("new Intl.NumberFormat('zh-SG').format(number)");
1511 }
1512
1513
1514
1515
1516 @Test
1517 @Alerts("31,415.927")
1518 public void format_zh_tw() throws Exception {
1519 test("new Intl.NumberFormat('zh-TW').format(number)");
1520 }
1521 }