/libcore/ojluni/src/test/java/time/test/java/time/format/ |
D | TestZoneOffsetParser.java | 100 TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("Z", pos); in test_parse_exactMatch_UTC() local 102 assertParsed(parsed, ZoneOffset.UTC); in test_parse_exactMatch_UTC() 107 TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("ZOTHER", pos); in test_parse_startStringMatch_UTC() local 109 assertParsed(parsed, ZoneOffset.UTC); in test_parse_startStringMatch_UTC() 114 … TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("OTHERZOTHER", pos); in test_parse_midStringMatch_UTC() local 116 assertParsed(parsed, ZoneOffset.UTC); in test_parse_midStringMatch_UTC() 121 TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("OTHERZ", pos); in test_parse_endStringMatch_UTC() local 123 assertParsed(parsed, ZoneOffset.UTC); in test_parse_endStringMatch_UTC() 129 TemporalAccessor parsed = getFormatter("+HH:MM:ss", "").parseUnresolved("", pos); in test_parse_exactMatch_UTC_EmptyUTC() local 131 assertParsed(parsed, ZoneOffset.UTC); in test_parse_exactMatch_UTC_EmptyUTC() [all …]
|
D | TestReducedParser.java | 132 TemporalAccessor parsed = getFormatter0(DAY_OF_YEAR, 3, 10).parseUnresolved("456", pos); in test_parse_fieldRangeIgnored() local 134 assertParsed(parsed, DAY_OF_YEAR, 456L); // parsed dayOfYear=456 in test_parse_fieldRangeIgnored() 189 … TemporalAccessor parsed = getFormatter0(field, width, baseValue).parseUnresolved(input, ppos); in test_parseAllStrict() local 192 assertEquals(parsed, parseVal, "unexpected parse result"); in test_parseAllStrict() 195 assertParsed(parsed, YEAR, parseVal != null ? (long) parseVal : null); in test_parseAllStrict() 203 … TemporalAccessor parsed = getFormatter0(field, width, baseValue).parseUnresolved(input, ppos); in test_parseAllLenient() local 206 assertEquals(parsed, parseVal, "unexpected parse result"); in test_parseAllLenient() 209 assertParsed(parsed, YEAR, parseVal != null ? (long) parseVal : null); in test_parseAllLenient() 276 …TemporalAccessor parsed = getFormatter0(field, minWidth, maxWidth, baseValue).parseUnresolved(inpu… in test_parseStrict() local 279 assertEquals(parsed, strict.parseVal, "unexpected parse result"); in test_parseStrict() [all …]
|
D | TestFractionPrinterParser.java | 249 …TemporalAccessor parsed = getFormatter(NANO_OF_SECOND, minWidth, maxWidth, true).parseUnresolved(r… in test_reverseParse() local 251 … assertParsed(parsed, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); in test_reverseParse() 257 …TemporalAccessor parsed = getFormatter(NANO_OF_SECOND, minWidth, maxWidth, false).parseUnresolved(… in test_reverseParse_noDecimalPoint() local 260 … assertParsed(parsed, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); in test_reverseParse_noDecimalPoint() 267 …TemporalAccessor parsed = getFormatter(NANO_OF_SECOND, minWidth, maxWidth, true).parseUnresolved(r… in test_reverseParse_followedByNonDigit() local 269 … assertParsed(parsed, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); in test_reverseParse_followedByNonDigit() 285 …TemporalAccessor parsed = getFormatter(NANO_OF_SECOND, minWidth, maxWidth, true).parseUnresolved("… in test_reverseParse_preceededByNonDigit() local 287 … assertParsed(parsed, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); in test_reverseParse_preceededByNonDigit() 301 …TemporalAccessor parsed = getFormatter(SECOND_OF_MINUTE, minWidth, maxWidth, true).parseUnresolved… in test_reverseParse_seconds() local 303 assertParsed(parsed, SECOND_OF_MINUTE, value == 0 && minWidth == 0 ? null : (long) value); in test_reverseParse_seconds() [all …]
|
D | TestNumberParser.java | 174 TemporalAccessor parsed = dtf.parseUnresolved(text, ppos); in test_parse_fresh() local 180 assertEquals(parsed.getLong(DAY_OF_MONTH), expectedValue); in test_parse_fresh() 181 assertEquals(parsed.query(TemporalQueries.chronology()), null); in test_parse_fresh() 182 assertEquals(parsed.query(TemporalQueries.zoneId()), null); in test_parse_fresh() 194 TemporalAccessor parsed = dtf.parseUnresolved(text, ppos); in test_parse_textField() local 200 assertEquals(parsed.getLong(DAY_OF_WEEK), expectedValue); in test_parse_textField() 201 assertEquals(parsed.query(TemporalQueries.chronology()), null); in test_parse_textField() 202 assertEquals(parsed.query(TemporalQueries.zoneId()), null); in test_parse_textField() 310 … TemporalAccessor parsed = getFormatter(DAY_OF_MONTH, min, max, style).parseUnresolved(input, pos); in test_parseSignsStrict() local 315 assertEquals(parsed.getLong(DAY_OF_MONTH), (long)parseVal); in test_parseSignsStrict() [all …]
|
D | TestDateTimeFormatterBuilder.java | 238 TemporalAccessor parsed = f.parseUnresolved("123", new ParsePosition(0)); in test_appendValue_subsequent2_parse3() local 239 assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L); in test_appendValue_subsequent2_parse3() 240 assertEquals(parsed.getLong(DAY_OF_MONTH), 23L); in test_appendValue_subsequent2_parse3() 248 TemporalAccessor parsed = f.parseUnresolved("0123", new ParsePosition(0)); in test_appendValue_subsequent2_parse4() local 249 assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L); in test_appendValue_subsequent2_parse4() 250 assertEquals(parsed.getLong(DAY_OF_MONTH), 23L); in test_appendValue_subsequent2_parse4() 258 TemporalAccessor parsed = f.parseUnresolved("01234", new ParsePosition(0)); in test_appendValue_subsequent2_parse5() local 259 assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L); in test_appendValue_subsequent2_parse5() 260 assertEquals(parsed.getLong(DAY_OF_MONTH), 23L); in test_appendValue_subsequent2_parse5() 271 TemporalAccessor parsed = f.parseUnresolved("20090630", new ParsePosition(0)); in test_appendValue_subsequent3_parse6() local [all …]
|
D | TestCharLiteralParser.java | 108 TemporalAccessor parsed = getFormatter(c).parseUnresolved(text, ppos); in test_parse_success() local 113 assertEquals(parsed.isSupported(YEAR), false); in test_parse_success() 114 assertEquals(parsed.query(TemporalQueries.chronology()), null); in test_parse_success() 115 assertEquals(parsed.query(TemporalQueries.zoneId()), null); in test_parse_success()
|
D | TestStringLiteralParser.java | 111 TemporalAccessor parsed = getFormatter(s).parseUnresolved(text, ppos); in test_parse_success() local 116 assertEquals(parsed.isSupported(YEAR), false); in test_parse_success() 117 assertEquals(parsed.query(TemporalQueries.chronology()), null); in test_parse_success() 118 assertEquals(parsed.query(TemporalQueries.zoneId()), null); in test_parse_success()
|
D | TestTextParser.java | 127 TemporalAccessor parsed = in test_parse_noMatch1() local 130 assertEquals(parsed, null); in test_parse_noMatch1() 135 TemporalAccessor parsed = in test_parse_noMatch2() local 138 assertEquals(parsed, null); in test_parse_noMatch2() 143 TemporalAccessor parsed = in test_parse_noMatch_atEnd() local 146 assertEquals(parsed, null); in test_parse_noMatch_atEnd()
|
/libcore/ojluni/src/test/java/time/tck/java/time/format/ |
D | TCKPadPrinterParser.java | 132 TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text, pos); in test_parseStrict() local 136 assertEquals(parsed.isSupported(MONTH_OF_YEAR), true); in test_parseStrict() 137 assertEquals(parsed.getLong(MONTH_OF_YEAR), expectedMonth.longValue()); in test_parseStrict() 139 assertEquals(parsed, null); in test_parseStrict() 173 TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text, pos); in test_parseLenient() local 177 assertEquals(parsed.isSupported(MONTH_OF_YEAR), true); in test_parseLenient() 178 assertEquals(parsed.getLong(MONTH_OF_YEAR), expectedMonth.longValue()); in test_parseLenient() 180 assertEquals(parsed, null); in test_parseLenient() 188 TemporalAccessor parsed = builder.toFormatter().parseUnresolved("--HELLO-", pos); in test_parse_decoratedStartsWithPad() local 191 assertEquals(parsed, null); in test_parse_decoratedStartsWithPad() [all …]
|
D | TCKLocalizedFieldParser.java | 129 TemporalAccessor parsed = dtf.parseUnresolved(text, ppos); in test_parse_textField() local 134 long value = parsed.getLong(field); in test_parse_textField() 161 TemporalAccessor parsed = dtf.parseUnresolved(text, ppos); in test_parse_textLocalDate() local 166 assertEquals(parsed.isSupported(YEAR_OF_ERA), true); in test_parse_textLocalDate() 167 assertEquals(parsed.isSupported(WeekFields.of(locale).dayOfWeek()), true); in test_parse_textLocalDate() 168 assertEquals(parsed.isSupported(WeekFields.of(locale).weekOfMonth()) || in test_parse_textLocalDate() 169 parsed.isSupported(WeekFields.of(locale).weekOfYear()), true); in test_parse_textLocalDate() 198 TemporalAccessor parsed = dtf.parseUnresolved(text, ppos); in test_parse_WeekBasedYear() local 204 assertEquals(parsed.isSupported(weekDef.dayOfWeek()), pattern.indexOf('e') >= 0); in test_parse_WeekBasedYear() 205 … assertEquals(parsed.isSupported(weekDef.weekOfWeekBasedYear()), pattern.indexOf('w') >= 0); in test_parse_WeekBasedYear() [all …]
|
D | TCKChronoPrinterParser.java | 123 TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text, pos); in test_parseValid_caseSensitive() local 126 assertEquals(parsed.query(TemporalQueries.chronology()), expected); in test_parseValid_caseSensitive() 132 …TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text.toLowerCase(Locale.ENGLISH), … in test_parseValid_caseSensitive_lowercaseRejected() local 135 assertEquals(parsed, null); in test_parseValid_caseSensitive_lowercaseRejected() 141 …TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text.toLowerCase(Locale.ENGLISH), … in test_parseValid_caseInsensitive() local 144 assertEquals(parsed.query(TemporalQueries.chronology()), expected); in test_parseValid_caseInsensitive() 161 TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text, pos); in test_parseInvalid() local 164 assertEquals(parsed, null); in test_parseInvalid()
|
D | TCKDateTimeFormatterBuilder.java | 122 LocalDate parsed = f.parse("", LocalDate::from); // blank string can be parsed in test_parseDefaulting_entireDate() local 123 assertEquals(parsed, LocalDate.of(2012, 6, 30)); in test_parseDefaulting_entireDate() 547 ZoneOffset parsed = f.parse(expected, ZoneOffset::from); in test_appendOffset_parse() local 548 assertEquals(f.format(parsed), expected); in test_appendOffset_parse() 1116 TemporalAccessor parsed = f.parseUnresolved("12309", pp); in test_adjacent_strict_firstFixedWidth() local 1119 assertEquals(parsed.getLong(HOUR_OF_DAY), 12L); in test_adjacent_strict_firstFixedWidth() 1120 assertEquals(parsed.getLong(MINUTE_OF_HOUR), 30L); in test_adjacent_strict_firstFixedWidth() 1128 TemporalAccessor parsed = f.parseUnresolved("12309Z", pp); in test_adjacent_strict_firstVariableWidth_success() local 1131 assertEquals(parsed.getLong(HOUR_OF_DAY), 123L); in test_adjacent_strict_firstVariableWidth_success() 1132 assertEquals(parsed.getLong(MINUTE_OF_HOUR), 9L); in test_adjacent_strict_firstVariableWidth_success() [all …]
|
D | TCKInstantPrinterParser.java | 295 TemporalAccessor parsed = f.withResolverStyle(style).parse("1970-02-03T24:00:00Z"); in test_parse_endOfDay() local 296 assertEquals(parsed.query(Instant::from), expected); in test_parse_endOfDay() 297 assertEquals(parsed.query(DateTimeFormatter.parsedExcessDays()), Period.ZERO); in test_parse_endOfDay() 298 assertEquals(parsed.query(DateTimeFormatter.parsedLeapSecond()), Boolean.FALSE); in test_parse_endOfDay() 307 … TemporalAccessor parsed = f.withResolverStyle(style).parse("1970-02-03T23:59:60.123456789Z"); in test_parse_leapSecond() local 308 assertEquals(parsed.query(Instant::from), expected); in test_parse_leapSecond() 309 assertEquals(parsed.query(DateTimeFormatter.parsedExcessDays()), Period.ZERO); in test_parse_leapSecond() 310 assertEquals(parsed.query(DateTimeFormatter.parsedLeapSecond()), Boolean.TRUE); in test_parse_leapSecond()
|
D | TCKZoneIdPrinterParser.java | 247 TemporalAccessor parsed = builder.toFormatter().parseUnresolved(lcText, pos); in test_ZoneId_parseSuccess_caseSensitive() local 250 assertEquals(parsed, null); in test_ZoneId_parseSuccess_caseSensitive() 299 TemporalAccessor parsed = builder.toFormatter().parseUnresolved(lcText, pos); in test_ZoneOrOffsetId_parseSuccess_caseSensitive() local 302 assertEquals(parsed, null); in test_ZoneOrOffsetId_parseSuccess_caseSensitive() 318 TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text, pos); in test() local 322 assertEquals(parsed.query(TemporalQueries.zoneId()), in test() 325 assertEquals(parsed.query(TemporalQueries.offset()), in test() 328 assertEquals(parsed.query(TemporalQueries.zone()), in test() 332 assertEquals(parsed, null); in test()
|
D | TCKDateTimeFormatter.java | 185 LocalDate parsed = f.parse("2012-6-30-321", LocalDate::from); // ignored day-of-year in test_resolverFields_selectOneDateResolveYMD() local 186 assertEquals(parsed, LocalDate.of(2012, 6, 30)); in test_resolverFields_selectOneDateResolveYMD() 204 LocalDate parsed = f.parse("2012-6-30-321", LocalDate::from); // ignored month/day-of-month in test_resolverFields_selectOneDateResolveYD() local 205 assertEquals(parsed, LocalDate.of(2012, 11, 16)); in test_resolverFields_selectOneDateResolveYD() 220 LocalDate parsed = f.parse("2012-321-1", LocalDate::from); // ignored wrong day-of-week in test_resolverFields_ignoreCrossCheck() local 221 assertEquals(parsed, LocalDate.of(2012, 11, 16)); in test_resolverFields_ignoreCrossCheck() 228 TemporalAccessor parsed = f.parse("2012"); in test_resolverFields_emptyList() local 229 assertEquals(parsed.isSupported(YEAR), false); // not in the list of resolverFields in test_resolverFields_emptyList() 236 TemporalAccessor parsed = f.parse("2012"); in test_resolverFields_listOfOneMatching() local 237 assertEquals(parsed.isSupported(YEAR), true); in test_resolverFields_listOfOneMatching() [all …]
|
D | TCKLocalizedPrinterParser.java | 164 TemporalAccessor parsed = f.parse(text, pos); in test_date_parse() local 167 assertEquals(LocalDate.from(parsed), date); in test_date_parse() 225 TemporalAccessor parsed = f.parse(text, pos); in test_time_parse() local 228 assertEquals(LocalTime.from(parsed), time); in test_time_parse()
|
/libcore/ojluni/src/main/java/java/time/format/ |
D | DateTimeParseContext.java | 109 private final ArrayList<Parsed> parsed = new ArrayList<>(); field in DateTimeParseContext 123 parsed.add(new Parsed()); in DateTimeParseContext() 287 parsed.add(currentParsed().copy()); in startOptional() 297 parsed.remove(parsed.size() - 2); in endOptional() 299 parsed.remove(parsed.size() - 1); in endOptional() 310 return parsed.get(parsed.size() - 1); in currentParsed() 328 Parsed parsed = currentParsed(); in toResolved() local 329 parsed.chrono = getEffectiveChronology(); in toResolved() 330 parsed.zone = (parsed.zone != null ? parsed.zone : formatter.getZone()); in toResolved() 331 return parsed.resolve(resolverStyle, resolverFields); in toResolved()
|
/libcore/ojluni/src/test/java/text/Format/NumberFormat/ |
D | BigDecimalParse.java | 106 Number parsed = null; field in BigDecimalParse 482 Object[] parsed = null; in test_Parse_in_MessageFormat_NotParseIntegerOnly() local 491 parsed = mf.parse(from[i], pp); in test_Parse_in_MessageFormat_NotParseIntegerOnly() 510 getType((Number)parsed[0])); in test_Parse_in_MessageFormat_NotParseIntegerOnly() 512 (Number)parsed[0]); in test_Parse_in_MessageFormat_NotParseIntegerOnly() 568 Object[] parsed = null; in test_Parse_in_MessageFormat_ParseIntegerOnly() local 578 parsed = mf.parse(from[i], pp); in test_Parse_in_MessageFormat_ParseIntegerOnly() 599 getType((Number)parsed[0])); in test_Parse_in_MessageFormat_ParseIntegerOnly() 601 (Number)parsed[0]); in test_Parse_in_MessageFormat_ParseIntegerOnly() 637 Number parsed = null; in test_Parse_in_DecimalFormat_ParseIntegerOnly() local [all …]
|
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/ |
D | TCKIsoFields.java | 161 LocalDate parsed = LocalDate.parse(date.getYear() + "-" + qoy + "-" + doq, f); in test_parse_quarters() local 162 assertEquals(parsed, date); in test_parse_quarters() 172 LocalDate parsed = LocalDate.parse(date.getYear() + "-" + qoy + "-" + doq, f); in test_parse_quarters_SMART() local 173 assertEquals(parsed, date); in test_parse_quarters_SMART() 183 LocalDate parsed = LocalDate.parse(date.getYear() + "-" + qoy + "-" + doq, f); in test_parse_quarters_LENIENT() local 184 assertEquals(parsed, date); in test_parse_quarters_LENIENT() 229 LocalDate parsed = LocalDate.parse(str, f); in test_parse_parseLenientQuarter_SMART() local 230 assertEquals(parsed, expected); in test_parse_parseLenientQuarter_SMART() 248 LocalDate parsed = LocalDate.parse(str, f); in test_parse_parseLenientQuarter_LENIENT() local 249 assertEquals(parsed, expected); in test_parse_parseLenientQuarter_LENIENT() [all …]
|
D | TCKJulianFields.java | 146 LocalDate parsed = LocalDate.parse(Long.toString(value), f); in test_samples_parse_STRICT() local 147 assertEquals(parsed, date); in test_samples_parse_STRICT() 154 LocalDate parsed = LocalDate.parse(Long.toString(value), f); in test_samples_parse_SMART() local 155 assertEquals(parsed, date); in test_samples_parse_SMART() 162 LocalDate parsed = LocalDate.parse(Long.toString(value), f); in test_samples_parse_LENIENT() local 163 assertEquals(parsed, date); in test_samples_parse_LENIENT()
|
D | TCKWeekFields.java | 394 LocalDate parsed = LocalDate.parse(str, f); in test_parse_resolve_localizedWom() local 395 assertEquals(parsed, date, " ::" + str + "::" + i); in test_parse_resolve_localizedWom() 417 LocalDate parsed = LocalDate.parse(str, f); in test_parse_resolve_localizedWom_lenient() local 418 assertEquals(parsed, date.plusWeeks(j - wom), " ::" + str + ": :" + i + "::" + j); in test_parse_resolve_localizedWom_lenient() 462 LocalDate parsed = LocalDate.parse(str, f); in test_parse_resolve_localizedWomDow() local 463 assertEquals(parsed, date, " :: " + str + " " + i); in test_parse_resolve_localizedWomDow() 486 LocalDate parsed = LocalDate.parse(str, f); in test_parse_resolve_localizedWomDow_lenient() local 487 assertEquals(parsed, date.plusWeeks(j - wom), " ::" + str + ": :" + i + "::" + j); in test_parse_resolve_localizedWomDow_lenient() 508 LocalDate parsed = LocalDate.parse(str, f); in test_parse_resolve_localizedWoy() local 509 assertEquals(parsed, date, " :: " + str + " " + i); in test_parse_resolve_localizedWoy() [all …]
|
/libcore/ojluni/src/main/java/java/time/ |
D | Duration.java | 412 …private static long parseNumber(CharSequence text, String parsed, int multiplier, String errorText… in parseNumber() argument 414 if (parsed == null) { in parseNumber() 418 long val = Long.parseLong(parsed); in parseNumber() 425 private static int parseFraction(CharSequence text, String parsed, int negate) { in parseFraction() argument 427 if (parsed == null || parsed.length() == 0) { in parseFraction() 431 parsed = (parsed + "000000000").substring(0, 9); in parseFraction() 432 return Integer.parseInt(parsed) * negate; in parseFraction()
|
/libcore/ojluni/src/test/java/util/HexFormat/ |
D | HexFormatTest.java | 709 byte[] parsed = formatFingerprint.parseHex(str); in samples() 710 System.out.println(" Parsed: " + Arrays.toString(parsed)); in samples() 711 assert(Arrays.equals(bytes, parsed)); in samples() 712 assertTrue(Arrays.equals(bytes, parsed)); in samples() 722 byte[] parsed = commaFormat.parseHex(str); in samples() 723 System.out.println(" Parsed: " + Arrays.toString(parsed)); in samples() 724 assert(Arrays.equals(bytes, parsed)); in samples() 725 assertTrue(Arrays.equals(bytes, parsed)); in samples() 734 byte[] parsed = commaFormat.parseHex(str); in samples() 735 System.out.println(" Parsed: " + Arrays.toString(parsed)); in samples() [all …]
|
/libcore/ojluni/src/test/java/time/test/java/time/temporal/ |
D | TestDateTimeBuilderCombinations.java | 149 TemporalAccessor parsed = dtfb.toFormatter().parse(str); in test_derive() local 152 assertEquals(parsed.query(LocalDate::from), expectedVal); in test_derive() 155 parsed.query(LocalDate::from); in test_derive()
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | LocaleLanguageRangeTest.java | 366 List<String> parsed = rangesToStrings(LanguageRange.parse("ccq-xx")); in testParse_multiEquivalent_consistency() local 368 assertEquals(parsed, rangesToStrings(LanguageRange.parse("ccq-xx"))); // consistency in testParse_multiEquivalent_consistency() 369 assertEquals(Arrays.asList("ccq-xx", "ybd-xx", "rki-xx"), parsed); // expected result in testParse_multiEquivalent_consistency()
|