Home
last modified time | relevance | path

Searched refs:parsed (Results 1 – 25 of 29) sorted by relevance

12

/libcore/ojluni/src/test/java/time/test/java/time/format/
DTestZoneOffsetParser.java100 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 …]
DTestReducedParser.java132 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 …]
DTestFractionPrinterParser.java246 …TemporalAccessor parsed = getFormatter(NANO_OF_SECOND, minWidth, maxWidth, true).parseUnresolved(r… in test_reverseParse() local
248 … assertParsed(parsed, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); in test_reverseParse()
254 …TemporalAccessor parsed = getFormatter(NANO_OF_SECOND, minWidth, maxWidth, false).parseUnresolved(… in test_reverseParse_noDecimalPoint() local
257 … assertParsed(parsed, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); in test_reverseParse_noDecimalPoint()
264 …TemporalAccessor parsed = getFormatter(NANO_OF_SECOND, minWidth, maxWidth, true).parseUnresolved(r… in test_reverseParse_followedByNonDigit() local
266 … assertParsed(parsed, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); in test_reverseParse_followedByNonDigit()
282 …TemporalAccessor parsed = getFormatter(NANO_OF_SECOND, minWidth, maxWidth, true).parseUnresolved("… in test_reverseParse_preceededByNonDigit() local
284 … assertParsed(parsed, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); in test_reverseParse_preceededByNonDigit()
298 …TemporalAccessor parsed = getFormatter(SECOND_OF_MINUTE, minWidth, maxWidth, true).parseUnresolved… in test_reverseParse_seconds() local
300 assertParsed(parsed, SECOND_OF_MINUTE, value == 0 && minWidth == 0 ? null : (long) value); in test_reverseParse_seconds()
[all …]
DTestNumberParser.java174 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 …]
DTestCharLiteralParser.java108 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()
DTestStringLiteralParser.java111 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()
DTestDateTimeFormatterBuilder.java228 TemporalAccessor parsed = f.parseUnresolved("123", new ParsePosition(0)); in test_appendValue_subsequent2_parse3() local
229 assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L); in test_appendValue_subsequent2_parse3()
230 assertEquals(parsed.getLong(DAY_OF_MONTH), 23L); in test_appendValue_subsequent2_parse3()
238 TemporalAccessor parsed = f.parseUnresolved("0123", new ParsePosition(0)); in test_appendValue_subsequent2_parse4() local
239 assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L); in test_appendValue_subsequent2_parse4()
240 assertEquals(parsed.getLong(DAY_OF_MONTH), 23L); in test_appendValue_subsequent2_parse4()
248 TemporalAccessor parsed = f.parseUnresolved("01234", new ParsePosition(0)); in test_appendValue_subsequent2_parse5() local
249 assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L); in test_appendValue_subsequent2_parse5()
250 assertEquals(parsed.getLong(DAY_OF_MONTH), 23L); in test_appendValue_subsequent2_parse5()
261 TemporalAccessor parsed = f.parseUnresolved("20090630", new ParsePosition(0)); in test_appendValue_subsequent3_parse6() local
[all …]
DTestTextParser.java126 TemporalAccessor parsed = in test_parse_noMatch1() local
129 assertEquals(parsed, null); in test_parse_noMatch1()
134 TemporalAccessor parsed = in test_parse_noMatch2() local
137 assertEquals(parsed, null); in test_parse_noMatch2()
142 TemporalAccessor parsed = in test_parse_noMatch_atEnd() local
145 assertEquals(parsed, null); in test_parse_noMatch_atEnd()
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKPadPrinterParser.java132 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 …]
DTCKZoneIdPrinterParser.java213 TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text, pos); in test_parseSuccess_plain() local
217 …assertEquals(parsed.query(TemporalQueries.zoneId()), expected, "Incorrect zoneId parsing: " + text… in test_parseSuccess_plain()
218 … assertEquals(parsed.query(TemporalQueries.offset()), null, "Incorrect offset parsing: " + text); in test_parseSuccess_plain()
219 … assertEquals(parsed.query(TemporalQueries.zone()), expected, "Incorrect zone parsing: " + text); in test_parseSuccess_plain()
221 assertEquals(parsed, null); in test_parseSuccess_plain()
230 TemporalAccessor parsed = builder.toFormatter().parseUnresolved(prefixText, pos); in test_parseSuccess_prefix() local
234 …assertEquals(parsed.query(TemporalQueries.zoneId()), expected, "Incorrect zoneId parsing: " + pref… in test_parseSuccess_prefix()
235 …assertEquals(parsed.query(TemporalQueries.offset()), null, "Incorrect offset parsing: " + prefixTe… in test_parseSuccess_prefix()
236 …assertEquals(parsed.query(TemporalQueries.zone()), expected, "Incorrect zone parsing: " + prefixTe… in test_parseSuccess_prefix()
238 assertEquals(parsed, null); in test_parseSuccess_prefix()
[all …]
DTCKDateTimeFormatterBuilder.java114 LocalDate parsed = f.parse("", LocalDate::from); // blank string can be parsed in test_parseDefaulting_entireDate() local
115 assertEquals(parsed, LocalDate.of(2012, 6, 30)); in test_parseDefaulting_entireDate()
392 ZoneOffset parsed = f.parse(expected, ZoneOffset::from); in test_appendOffset_parse() local
393 assertEquals(f.format(parsed), expected); in test_appendOffset_parse()
741 TemporalAccessor parsed = f.parseUnresolved("12309", pp); in test_adjacent_strict_firstFixedWidth() local
744 assertEquals(parsed.getLong(HOUR_OF_DAY), 12L); in test_adjacent_strict_firstFixedWidth()
745 assertEquals(parsed.getLong(MINUTE_OF_HOUR), 30L); in test_adjacent_strict_firstFixedWidth()
753 TemporalAccessor parsed = f.parseUnresolved("12309Z", pp); in test_adjacent_strict_firstVariableWidth_success() local
756 assertEquals(parsed.getLong(HOUR_OF_DAY), 123L); in test_adjacent_strict_firstVariableWidth_success()
757 assertEquals(parsed.getLong(MINUTE_OF_HOUR), 9L); in test_adjacent_strict_firstVariableWidth_success()
[all …]
DTCKLocalizedFieldParser.java121 TemporalAccessor parsed = dtf.parseUnresolved(text, ppos); in test_parse_textField() local
126 long value = parsed.getLong(field); in test_parse_textField()
153 TemporalAccessor parsed = dtf.parseUnresolved(text, ppos); in test_parse_textLocalDate() local
158 assertEquals(parsed.isSupported(YEAR_OF_ERA), true); in test_parse_textLocalDate()
159 assertEquals(parsed.isSupported(WeekFields.of(locale).dayOfWeek()), true); in test_parse_textLocalDate()
160 assertEquals(parsed.isSupported(WeekFields.of(locale).weekOfMonth()) || in test_parse_textLocalDate()
161 parsed.isSupported(WeekFields.of(locale).weekOfYear()), true); in test_parse_textLocalDate()
190 TemporalAccessor parsed = dtf.parseUnresolved(text, ppos); in test_parse_WeekBasedYear() local
196 assertEquals(parsed.isSupported(weekDef.dayOfWeek()), pattern.indexOf('e') >= 0); in test_parse_WeekBasedYear()
197 … assertEquals(parsed.isSupported(weekDef.weekOfWeekBasedYear()), pattern.indexOf('w') >= 0); in test_parse_WeekBasedYear()
[all …]
DTCKChronoPrinterParser.java123 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()
DTCKInstantPrinterParser.java256 TemporalAccessor parsed = f.withResolverStyle(style).parse("1970-02-03T24:00:00Z"); in test_parse_endOfDay() local
257 assertEquals(parsed.query(Instant::from), expected); in test_parse_endOfDay()
258 assertEquals(parsed.query(DateTimeFormatter.parsedExcessDays()), Period.ZERO); in test_parse_endOfDay()
259 assertEquals(parsed.query(DateTimeFormatter.parsedLeapSecond()), Boolean.FALSE); in test_parse_endOfDay()
268 … TemporalAccessor parsed = f.withResolverStyle(style).parse("1970-02-03T23:59:60.123456789Z"); in test_parse_leapSecond() local
269 assertEquals(parsed.query(Instant::from), expected); in test_parse_leapSecond()
270 assertEquals(parsed.query(DateTimeFormatter.parsedExcessDays()), Period.ZERO); in test_parse_leapSecond()
271 assertEquals(parsed.query(DateTimeFormatter.parsedLeapSecond()), Boolean.TRUE); in test_parse_leapSecond()
DTCKDateTimeFormatter.java185 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 …]
DTCKLocalizedPrinterParser.java162 TemporalAccessor parsed = f.parse(text, pos); in test_date_parse() local
165 assertEquals(LocalDate.from(parsed), date); in test_date_parse()
215 TemporalAccessor parsed = f.parse(text, pos); in test_time_parse() local
218 assertEquals(LocalTime.from(parsed), time); in test_time_parse()
/libcore/ojluni/src/main/java/java/time/format/
DDateTimeParseContext.java109 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/time/tck/java/time/temporal/
DTCKIsoFields.java158 LocalDate parsed = LocalDate.parse(date.getYear() + "-" + qoy + "-" + doq, f); in test_parse_quarters() local
159 assertEquals(parsed, date); in test_parse_quarters()
169 LocalDate parsed = LocalDate.parse(date.getYear() + "-" + qoy + "-" + doq, f); in test_parse_quarters_SMART() local
170 assertEquals(parsed, date); in test_parse_quarters_SMART()
180 LocalDate parsed = LocalDate.parse(date.getYear() + "-" + qoy + "-" + doq, f); in test_parse_quarters_LENIENT() local
181 assertEquals(parsed, date); in test_parse_quarters_LENIENT()
226 LocalDate parsed = LocalDate.parse(str, f); in test_parse_parseLenientQuarter_SMART() local
227 assertEquals(parsed, expected); in test_parse_parseLenientQuarter_SMART()
245 LocalDate parsed = LocalDate.parse(str, f); in test_parse_parseLenientQuarter_LENIENT() local
246 assertEquals(parsed, expected); in test_parse_parseLenientQuarter_LENIENT()
[all …]
DTCKJulianFields.java146 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()
DTCKWeekFields.java392 LocalDate parsed = LocalDate.parse(str, f); in test_parse_resolve_localizedWom() local
393 assertEquals(parsed, date, " ::" + str + "::" + i); in test_parse_resolve_localizedWom()
415 LocalDate parsed = LocalDate.parse(str, f); in test_parse_resolve_localizedWom_lenient() local
416 assertEquals(parsed, date.plusWeeks(j - wom), " ::" + str + ": :" + i + "::" + j); in test_parse_resolve_localizedWom_lenient()
460 LocalDate parsed = LocalDate.parse(str, f); in test_parse_resolve_localizedWomDow() local
461 assertEquals(parsed, date, " :: " + str + " " + i); in test_parse_resolve_localizedWomDow()
484 LocalDate parsed = LocalDate.parse(str, f); in test_parse_resolve_localizedWomDow_lenient() local
485 assertEquals(parsed, date.plusWeeks(j - wom), " ::" + str + ": :" + i + "::" + j); in test_parse_resolve_localizedWomDow_lenient()
506 LocalDate parsed = LocalDate.parse(str, f); in test_parse_resolve_localizedWoy() local
507 assertEquals(parsed, date, " :: " + str + " " + i); in test_parse_resolve_localizedWoy()
[all …]
/libcore/ojluni/src/main/java/java/time/
DDuration.java409 …private static long parseNumber(CharSequence text, String parsed, int multiplier, String errorText… in parseNumber() argument
411 if (parsed == null) { in parseNumber()
415 long val = Long.parseLong(parsed); in parseNumber()
422 private static int parseFraction(CharSequence text, String parsed, int negate) { in parseFraction() argument
424 if (parsed == null || parsed.length() == 0) { in parseFraction()
428 parsed = (parsed + "000000000").substring(0, 9); in parseFraction()
429 return Integer.parseInt(parsed) * negate; in parseFraction()
/libcore/ojluni/src/test/java/time/test/java/time/temporal/
DTestDateTimeBuilderCombinations.java149 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/
DLocaleLanguageRangeTest.java366 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()
/libcore/ojluni/src/main/java/sun/util/locale/
DInternalLocaleBuilder.java236 int parsed = 0; in setExtensions() local
252 parsed = itr.currentEnd(); in setExtensions()
259 if (parsed < start) { in setExtensions()
285 parsed = itr.currentEnd(); in setExtensions()
289 if (parsed <= start) { in setExtensions()
/libcore/ojluni/annotations/hiddenapi/java/time/
DDuration.java119 java.lang.String parsed, in parseNumber() argument
126 java.lang.CharSequence text, java.lang.String parsed, int negate) { in parseFraction() argument

12