Home
last modified time | relevance | path

Searched refs:fmt (Results 1 – 13 of 13) sorted by relevance

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DChoiceFormatTest.java404 ChoiceFormat fmt = new ChoiceFormat( in test_formatL() local
407 assertEquals("NEGATIVE_ONE", fmt.format(Long.MIN_VALUE)); in test_formatL()
408 assertEquals("NEGATIVE_ONE", fmt.format(-1)); in test_formatL()
409 assertEquals("ZERO", fmt.format(0)); in test_formatL()
410 assertEquals("ONE", fmt.format(1)); in test_formatL()
411 assertEquals("GREATER_THAN_ONE", fmt.format(Long.MAX_VALUE)); in test_formatL()
418 ChoiceFormat fmt = new ChoiceFormat( in test_formatD() local
420 assertEquals("NEGATIVE_ONE", fmt.format(Double.NEGATIVE_INFINITY)); in test_formatD()
421 assertEquals("NEGATIVE_ONE", fmt.format(-999999999D)); in test_formatD()
422 assertEquals("NEGATIVE_ONE", fmt.format(-1.1)); in test_formatD()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DOldFormattableTest.java49 Formatter fmt = new Formatter(); in testFormatTo() local
52 assertTrue(fmt.format("%1.1s", mf).toString().equals("single precision ")); in testFormatTo()
53 assertTrue(fmt.format("%2.1s", mf).toString().equals("single precision single precision ")); in testFormatTo()
54 …assertTrue(fmt.format("%2.2s", mf).toString().equals("single precision single precision double pre… in testFormatTo()
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKDateTimeFormatter.java125 private DateTimeFormatter fmt; field in TCKDateTimeFormatter
129 fmt = new DateTimeFormatterBuilder().appendLiteral("ONE") in setUp()
137 … DateTimeFormatter base = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_withLocale()
144 … DateTimeFormatter base = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_withLocale_null()
151 DateTimeFormatter test = fmt; in test_withChronology()
162 DateTimeFormatter test = fmt; in test_withZone()
403 … DateTimeFormatter test = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_format_TemporalAccessor_simple()
410 … DateTimeFormatter test = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_format_TemporalAccessor_noSuchField()
416 … DateTimeFormatter test = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_format_TemporalAccessor_null()
423 … DateTimeFormatter test = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_print_TemporalAppendable()
[all …]
DTCKDateTimeParseResolver.java1169 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_InstantSeconds() local
1171 TemporalAccessor acc = fmt.parse("86402"); in test_parse_fromField_InstantSeconds()
1186 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_InstantSeconds_NanoOfSecond() local
1188 TemporalAccessor acc = fmt.parse("86402.123456789"); in test_parse_fromField_InstantSeconds_NanoOfSecond()
1204 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_SecondOfDay() local
1206 TemporalAccessor acc = fmt.parse("864"); in test_parse_fromField_SecondOfDay()
1219 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_SecondOfDay_NanoOfSecond() local
1221 TemporalAccessor acc = fmt.parse("864.123456789"); in test_parse_fromField_SecondOfDay_NanoOfSecond()
1235 DateTimeFormatter fmt = new DateTimeFormatterBuilder() in test_parse_fromField_SecondOfMinute() local
1237 TemporalAccessor acc = fmt.parse("32"); in test_parse_fromField_SecondOfMinute()
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/
DAbstractTCKTest.java212 Formatter fmt = new Formatter(sb); in dumpSerialStream() local
213 fmt.format(" byte[] bytes = {" ); in dumpSerialStream()
217 fmt.format("%n "); in dumpSerialStream()
219 fmt.format(" %3d,", bytes[i] & 0xff); in dumpSerialStream()
221 fmt.format(" /*"); in dumpSerialStream()
225 fmt.format(" %c", bytes[s + j] & 0xff); in dumpSerialStream()
227 fmt.format(" */"); in dumpSerialStream()
230 fmt.format("%n };%n"); in dumpSerialStream()
/libcore/ojluni/src/main/java/java/text/
DMessageFormat.java530 Format fmt = formats[i]; in toPattern() local
531 if (fmt == null) { in toPattern()
533 } else if (fmt instanceof NumberFormat) { in toPattern()
534 if (fmt.equals(NumberFormat.getInstance(locale))) { in toPattern()
536 } else if (fmt.equals(NumberFormat.getCurrencyInstance(locale))) { in toPattern()
538 } else if (fmt.equals(NumberFormat.getPercentInstance(locale))) { in toPattern()
540 } else if (fmt.equals(NumberFormat.getIntegerInstance(locale))) { in toPattern()
543 if (fmt instanceof DecimalFormat) { in toPattern()
544 result.append(",number,").append(((DecimalFormat)fmt).toPattern()); in toPattern()
545 } else if (fmt instanceof ChoiceFormat) { in toPattern()
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/format/
DTestZoneTextPrinterParser.java205 DateTimeFormatter fmt = new DateTimeFormatterBuilder().appendZoneText(style, preferred) in test_ParseText() local
209 String ret = fmt.parse(text, TemporalQueries.zone()).getId(); in test_ParseText()
223 DateTimeFormatter fmt = getFormatter(locale, style, ci); in parseText() local
231 parse(fmt, zid, expected, zid, locale, style, ci); in parseText()
234 parse(fmt, zid, expected, names[i], locale, style, ci); in parseText()
239 private void parse(DateTimeFormatter fmt, in parse() argument
245 String ret = fmt.parse(text, TemporalQueries.zone()).getId(); in parse()
DTestDateTimeTextProvider.java185 DateTimeFormatter fmt = getFormatter(field, style).withLocale(locale); in test_getText() local
186 assertEquals(fmt.format(ZonedDateTime.now().with(field, value.longValue())), expected); in test_getText()
/libcore/ojluni/annotations/hiddenapi/java/io/
DConsole.java50 public java.io.Console format(java.lang.String fmt, java.lang.Object... args) { in format() argument
58 public java.lang.String readLine(java.lang.String fmt, java.lang.Object... args) { in readLine() argument
66 public char[] readPassword(java.lang.String fmt, java.lang.Object... args) { in readPassword() argument
/libcore/luni/src/test/java/libcore/libcore/icu/
DDateIntervalFormatTest.java441 BiFunction<Long, Long, String> fmt = (from, to) -> formatDateRange( in testEndAtMidnight_dateAndTime() local
445 assertEquals("February 27, 2007, 04:00 – 00:00", fmt.apply(1172548800000L, 1172620800000L)); in testEndAtMidnight_dateAndTime()
448 fmt.apply(1172534400000L, 1172620800000L)); in testEndAtMidnight_dateAndTime()
452 fmt.apply(1172548800000L, 1172620800001L)); in testEndAtMidnight_dateAndTime()
454 fmt.apply(1172548800000L, 1172707200000L)); in testEndAtMidnight_dateAndTime()
458 fmt.apply(1172534459999L, 1172620800000L)); in testEndAtMidnight_dateAndTime()
460 assertEquals("February 27, 2007, 00:01 – 00:00", fmt.apply(1172534460000L, 1172620800000L)); in testEndAtMidnight_dateAndTime()
465 BiFunction<Long, Long, String> fmt = (from, to) -> formatDateRange( in testEndAtMidnight_dateOnly() local
470 assertEquals("February 27 – March 1, 2007", fmt.apply(1172534400000L, 1172793600000L)); in testEndAtMidnight_dateOnly()
471 assertEquals("February 27 – March 1, 2007", fmt.apply(1172548800000L, 1172793600000L)); in testEndAtMidnight_dateOnly()
[all …]
/libcore/ojluni/src/main/native/
DUnixFileSystem_md.c133 int fmt = mode & S_IFMT; in Java_java_io_UnixFileSystem_getBooleanAttributes0() local
135 | ((fmt == S_IFREG) ? java_io_FileSystem_BA_REGULAR : 0) in Java_java_io_UnixFileSystem_getBooleanAttributes0()
136 | ((fmt == S_IFDIR) ? java_io_FileSystem_BA_DIRECTORY : 0)); in Java_java_io_UnixFileSystem_getBooleanAttributes0()
Djvm.h1269 jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
1272 jio_snprintf(char *str, size_t count, const char *fmt, ...);
1275 jio_fprintf(FILE *, const char *fmt, ...);
1278 jio_vfprintf(FILE *, const char *fmt, va_list args);
/libcore/luni/src/test/java/libcore/java/text/
DDateFormatSymbolsTest.java88 private String formatDate(Locale l, String fmt, DateFormatSymbols dfs) { in formatDate() argument
89 SimpleDateFormat sdf = new SimpleDateFormat(fmt, l); in formatDate()