Lines Matching refs:test

24 /* Type-specific source code for unit test
27 * We check in the generated source files so that the test tree can be used
47 private static void test(String fs, String exp, Object ... args) {
57 private static void test(Locale l, String fs, String exp, Object ... args)
68 private static void test(String fs, Object ... args) {
74 private static void test(String fs) {
118 test(fs);
132 test(fs, args);
338 public static void test() {
354 test(Locale.FRANCE, "e = %+10.4f", "e = +2,7183", Math.E);
355 test("%4$2s %3$2s %2$2s %1$2s", " d c b a", "a", "b", "c", "d");
356 test("Amount gained or lost since last statement: $ %,(.2f",
362 test("Unable to open file '%1$s': %2$s",
367 test("Duke's Birthday: %1$tB %1$te, %1$tY",
370 test("Duke's Birthday: %1$tB %1$te, %1$tY",
373 test("Duke's Birthday: %1$tB %1$te, %1$tY",
377 test("%4$s %3$s %2$s %1$s %4$s %3$s %2$s %1$s",
379 test("%s %s %<s %<s", "a b b b", "a", "b", "c", "d");
380 test("%s %s %s %s", "a b c d", "a", "b", "c", "d");
381 test("%2$s %s %<s %s", "b a a b", "a", "b", "c", "d");
388 test("%b", "true", true);
389 test("%b", "false", false);
390 test("%B", "TRUE", true);
391 test("%B", "FALSE", false);
392 test("%b", "true", Boolean.TRUE);
393 test("%b", "false", Boolean.FALSE);
394 test("%B", "TRUE", Boolean.TRUE);
395 test("%B", "FALSE", Boolean.FALSE);
396 test("%14b", " true", true);
397 test("%-14b", "true ", true);
398 test("%5.1b", " f", false);
399 test("%-5.1b", "f ", false);
401 test("%b", "true", "foo");
402 test("%b", "false", (Object)null);
406 test(Locale.FRANCE, "%b", "true", true);
407 test(Locale.FRANCE, "%b", "false", false);
412 test("%b", "false", (Object[])new String[2]);
413 test("%b", "true", new String[2], new String[2]);
416 test("%b", "true", ia);
432 test("%c", "i", 'i');
433 test("%C", "I", 'i');
434 test("%4c", " i", 'i');
435 test("%-4c", "i ", 'i');
436 test("%4C", " I", 'i');
437 test("%-4C", "I ", 'i');
438 test("%c", "i", new Character('i'));
439 test("%c", "H", (byte) 72);
440 test("%c", "i", (short) 105);
441 test("%c", "!", (int) 33);
442 test("%c", "\u007F", Byte.MAX_VALUE);
443 test("%c", new String(Character.toChars(Short.MAX_VALUE)),
445 test("%c", "null", (Object) null);
476 test("%s", "Hello, Duke", "Hello, Duke");
477 test("%S", "HELLO, DUKE", "Hello, Duke");
478 test("%20S", " HELLO, DUKE", "Hello, Duke");
479 test("%20s", " Hello, Duke", "Hello, Duke");
480 test("%-20s", "Hello, Duke ", "Hello, Duke");
481 test("%-20.5s", "Hello ", "Hello, Duke");
482 test("%s", "null", (Object)null);
485 test("%s", sb.toString(), sb);
486 test("%S", sb.toString().toUpperCase(), sb);
503 test("%h", Integer.toHexString("Hello, Duke".hashCode()),
505 test("%10h", " ddf63471", "Hello, Duke");
506 test("%-10h", "ddf63471 ", "Hello, Duke");
507 test("%-10H", "DDF63471 ", "Hello, Duke");
508 test("%10h", " 402e0000", 15.0);
509 test("%10H", " 402E0000", 15.0);
789 test("%d", "null", (Object)null);
790 test("%d", "1234567", new BigInteger("1234567", 10));
791 test("%,d", "1,234,567", new BigInteger("1234567", 10));
792 test(Locale.FRANCE, "%,d", "1\u00a0234\u00a0567", new BigInteger("1234567", 10));
793 test("%,d", "-1,234,567", new BigInteger("-1234567", 10));
794 test("%(d", "1234567", new BigInteger("1234567", 10));
795 test("%(d", "(1234567)", new BigInteger("-1234567", 10));
796 test("% d", " 1234567", new BigInteger("1234567", 10));
797 test("% d", "-1234567", new BigInteger("-1234567", 10));
798 test("%+d", "+1234567", new BigInteger("1234567", 10));
799 test("%+d", "-1234567", new BigInteger("-1234567", 10));
800 test("%010d", "0001234567", new BigInteger("1234567", 10));
801 test("%010d", "-001234567", new BigInteger("-1234567", 10));
802 test("%(10d", " (1234567)", new BigInteger("-1234567", 10));
803 test("%+d", "+1234567", new BigInteger("1234567", 10));
804 test("%+d", "-1234567", new BigInteger("-1234567", 10));
805 test("%-10d", "1234567 ", new BigInteger("1234567", 10));
806 test("%-10d", "-1234567 ", new BigInteger("-1234567", 10));
808 test("%0,10d", "01,234,567", new BigInteger("1234567", 10));
809 test("%0,10d", "-1,234,567", new BigInteger("-1234567", 10));
810 test("%(,10d", "(1,234,567)", new BigInteger("-1234567", 10));
811 test("%+,d", "+1,234,567", new BigInteger("1234567", 10));
812 test("%+,d", "-1,234,567", new BigInteger("-1234567", 10));
813 test("%-,10d", "1,234,567 ", new BigInteger("1234567", 10));
814 test("%-,10d", "-1,234,567", new BigInteger("-1234567", 10));
819 test("%o", "null", (Object)null);
820 test("%o", "1234567", new BigInteger("1234567", 8));
821 test("%(o", "1234567", new BigInteger("1234567", 8));
822 test("%(o", "(1234567)", new BigInteger("-1234567", 8));
823 test("% o", " 1234567", new BigInteger("1234567", 8));
824 test("% o", "-1234567", new BigInteger("-1234567", 8));
825 test("%+o", "+1234567", new BigInteger("1234567", 8));
826 test("%+o", "-1234567", new BigInteger("-1234567", 8));
827 test("%010o", "0001234567", new BigInteger("1234567", 8));
828 test("%010o", "-001234567", new BigInteger("-1234567", 8));
829 test("%(10o", " (1234567)", new BigInteger("-1234567", 8));
830 test("%+o", "+1234567", new BigInteger("1234567", 8));
831 test("%+o", "-1234567", new BigInteger("-1234567", 8));
832 test("%-10o", "1234567 ", new BigInteger("1234567", 8));
833 test("%-10o", "-1234567 ", new BigInteger("-1234567", 8));
834 test("%#10o", " 01234567", new BigInteger("1234567", 8));
835 test("%#10o", " -01234567", new BigInteger("-1234567", 8));
840 test("%x", "null", (Object)null);
841 test("%x", "1234567", new BigInteger("1234567", 16));
842 test("%(x", "1234567", new BigInteger("1234567", 16));
843 test("%(x", "(1234567)", new BigInteger("-1234567", 16));
844 test("% x", " 1234567", new BigInteger("1234567", 16));
845 test("% x", "-1234567", new BigInteger("-1234567", 16));
846 test("%+x", "+1234567", new BigInteger("1234567", 16));
847 test("%+x", "-1234567", new BigInteger("-1234567", 16));
848 test("%010x", "0001234567", new BigInteger("1234567", 16));
849 test("%010x", "-001234567", new BigInteger("-1234567", 16));
850 test("%(10x", " (1234567)", new BigInteger("-1234567", 16));
851 test("%+x", "+1234567", new BigInteger("1234567", 16));
852 test("%+x", "-1234567", new BigInteger("-1234567", 16));
853 test("%-10x", "1234567 ", new BigInteger("1234567", 16));
854 test("%-10x", "-1234567 ", new BigInteger("-1234567", 16));
855 test("%#10x", " 0x1234567", new BigInteger("1234567", 16));
856 test("%#10x", "-0x1234567", new BigInteger("-1234567", 16));
857 test("%#10X", " 0X1234567", new BigInteger("1234567", 16));
858 test("%#10X", "-0X1234567", new BigInteger("-1234567", 16));
859 test("%X", "1234567A", new BigInteger("1234567a", 16));
860 test("%X", "-1234567A", new BigInteger("-1234567a", 16));
1669 test("%tA", "null", (Object)null);
1670 test("%TA", "NULL", (Object)null);
1780 test("%n", System.getProperty("line.separator"), (Object)null);
1781 test("%n", System.getProperty("line.separator"), "");
1793 test("%%", "%", (Object)null);
1794 test("%%", "%", "");