Java Code Examples for java.time.format.SignStyle#NORMAL
The following examples show how to use
java.time.format.SignStyle#NORMAL .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TCKSignStyle.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@DataProvider(name="signStyle") Object[][] data_signStyle() { return new Object[][] { {LocalDate.of(0, 10, 2), SignStyle.ALWAYS, null, "+00"}, {LocalDate.of(2001, 10, 2), SignStyle.ALWAYS, null, "+2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.ALWAYS, null, "-2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NORMAL, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NORMAL, null, "-2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NEVER, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NEVER, null, "2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NOT_NEGATIVE, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NOT_NEGATIVE, DateTimeException.class, ""}, {LocalDate.of(0, 10, 2), SignStyle.EXCEEDS_PAD, null, "00"}, {LocalDate.of(1, 10, 2), SignStyle.EXCEEDS_PAD, null, "01"}, {LocalDate.of(-1, 10, 2), SignStyle.EXCEEDS_PAD, null, "-01"}, {LocalDate.of(20001, 10, 2), SignStyle.ALWAYS, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NORMAL, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NEVER, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.EXCEEDS_PAD, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NOT_NEGATIVE, DateTimeException.class, ""}, }; }
Example 2
Source File: TCKSignStyle.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
@DataProvider(name="signStyle") Object[][] data_signStyle() { return new Object[][] { {LocalDate.of(0, 10, 2), SignStyle.ALWAYS, null, "+00"}, {LocalDate.of(2001, 10, 2), SignStyle.ALWAYS, null, "+2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.ALWAYS, null, "-2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NORMAL, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NORMAL, null, "-2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NEVER, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NEVER, null, "2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NOT_NEGATIVE, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NOT_NEGATIVE, DateTimeException.class, ""}, {LocalDate.of(0, 10, 2), SignStyle.EXCEEDS_PAD, null, "00"}, {LocalDate.of(1, 10, 2), SignStyle.EXCEEDS_PAD, null, "01"}, {LocalDate.of(-1, 10, 2), SignStyle.EXCEEDS_PAD, null, "-01"}, {LocalDate.of(20001, 10, 2), SignStyle.ALWAYS, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NORMAL, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NEVER, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.EXCEEDS_PAD, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NOT_NEGATIVE, DateTimeException.class, ""}, }; }
Example 3
Source File: TCKSignStyle.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@DataProvider(name="signStyle") Object[][] data_signStyle() { return new Object[][] { {LocalDate.of(0, 10, 2), SignStyle.ALWAYS, null, "+00"}, {LocalDate.of(2001, 10, 2), SignStyle.ALWAYS, null, "+2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.ALWAYS, null, "-2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NORMAL, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NORMAL, null, "-2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NEVER, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NEVER, null, "2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NOT_NEGATIVE, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NOT_NEGATIVE, DateTimeException.class, ""}, {LocalDate.of(0, 10, 2), SignStyle.EXCEEDS_PAD, null, "00"}, {LocalDate.of(1, 10, 2), SignStyle.EXCEEDS_PAD, null, "01"}, {LocalDate.of(-1, 10, 2), SignStyle.EXCEEDS_PAD, null, "-01"}, {LocalDate.of(20001, 10, 2), SignStyle.ALWAYS, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NORMAL, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NEVER, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.EXCEEDS_PAD, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NOT_NEGATIVE, DateTimeException.class, ""}, }; }
Example 4
Source File: TCKSignStyle.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
@DataProvider(name="signStyle") Object[][] data_signStyle() { return new Object[][] { {LocalDate.of(0, 10, 2), SignStyle.ALWAYS, null, "+00"}, {LocalDate.of(2001, 10, 2), SignStyle.ALWAYS, null, "+2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.ALWAYS, null, "-2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NORMAL, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NORMAL, null, "-2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NEVER, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NEVER, null, "2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NOT_NEGATIVE, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NOT_NEGATIVE, DateTimeException.class, ""}, {LocalDate.of(0, 10, 2), SignStyle.EXCEEDS_PAD, null, "00"}, {LocalDate.of(1, 10, 2), SignStyle.EXCEEDS_PAD, null, "01"}, {LocalDate.of(-1, 10, 2), SignStyle.EXCEEDS_PAD, null, "-01"}, {LocalDate.of(20001, 10, 2), SignStyle.ALWAYS, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NORMAL, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NEVER, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.EXCEEDS_PAD, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NOT_NEGATIVE, DateTimeException.class, ""}, }; }
Example 5
Source File: TCKSignStyle.java From hottub with GNU General Public License v2.0 | 5 votes |
@DataProvider(name="signStyle") Object[][] data_signStyle() { return new Object[][] { {LocalDate.of(0, 10, 2), SignStyle.ALWAYS, null, "+00"}, {LocalDate.of(2001, 10, 2), SignStyle.ALWAYS, null, "+2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.ALWAYS, null, "-2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NORMAL, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NORMAL, null, "-2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NEVER, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NEVER, null, "2001"}, {LocalDate.of(2001, 10, 2), SignStyle.NOT_NEGATIVE, null, "2001"}, {LocalDate.of(-2001, 10, 2), SignStyle.NOT_NEGATIVE, DateTimeException.class, ""}, {LocalDate.of(0, 10, 2), SignStyle.EXCEEDS_PAD, null, "00"}, {LocalDate.of(1, 10, 2), SignStyle.EXCEEDS_PAD, null, "01"}, {LocalDate.of(-1, 10, 2), SignStyle.EXCEEDS_PAD, null, "-01"}, {LocalDate.of(20001, 10, 2), SignStyle.ALWAYS, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NORMAL, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NEVER, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.EXCEEDS_PAD, DateTimeException.class, ""}, {LocalDate.of(20001, 10, 2), SignStyle.NOT_NEGATIVE, DateTimeException.class, ""}, }; }
Example 6
Source File: TestNumberParser.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseDigitsLenient") Object[][] provider_parseDigitsLenient() { return new Object[][] { // never {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"5", 2, 2, SignStyle.NEVER, 1, 5}, {"54", 1, 3, SignStyle.NEVER, 2, 54}, {"54", 2, 3, SignStyle.NEVER, 2, 54}, {"54", 3, 3, SignStyle.NEVER, 2, 54}, {"543", 1, 3, SignStyle.NEVER, 3, 543}, {"543", 2, 3, SignStyle.NEVER, 3, 543}, {"543", 3, 3, SignStyle.NEVER, 3, 543}, {"5432", 1, 3, SignStyle.NEVER, 4, 5432}, {"5432", 2, 3, SignStyle.NEVER, 4, 5432}, {"5432", 3, 3, SignStyle.NEVER, 4, 5432}, {"5AAA", 2, 3, SignStyle.NEVER, 1, 5}, // not negative {"5", 1, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"5", 2, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"54", 1, 3, SignStyle.NOT_NEGATIVE, 2, 54}, {"54", 2, 3, SignStyle.NOT_NEGATIVE, 2, 54}, {"54", 3, 3, SignStyle.NOT_NEGATIVE, 2, 54}, {"543", 1, 3, SignStyle.NOT_NEGATIVE, 3, 543}, {"543", 2, 3, SignStyle.NOT_NEGATIVE, 3, 543}, {"543", 3, 3, SignStyle.NOT_NEGATIVE, 3, 543}, {"5432", 1, 3, SignStyle.NOT_NEGATIVE, 4, 5432}, {"5432", 2, 3, SignStyle.NOT_NEGATIVE, 4, 5432}, {"5432", 3, 3, SignStyle.NOT_NEGATIVE, 4, 5432}, {"5AAA", 2, 3, SignStyle.NOT_NEGATIVE, 1, 5}, // normal {"5", 1, 2, SignStyle.NORMAL, 1, 5}, {"5", 2, 2, SignStyle.NORMAL, 1, 5}, {"54", 1, 3, SignStyle.NORMAL, 2, 54}, {"54", 2, 3, SignStyle.NORMAL, 2, 54}, {"54", 3, 3, SignStyle.NORMAL, 2, 54}, {"543", 1, 3, SignStyle.NORMAL, 3, 543}, {"543", 2, 3, SignStyle.NORMAL, 3, 543}, {"543", 3, 3, SignStyle.NORMAL, 3, 543}, {"5432", 1, 3, SignStyle.NORMAL, 4, 5432}, {"5432", 2, 3, SignStyle.NORMAL, 4, 5432}, {"5432", 3, 3, SignStyle.NORMAL, 4, 5432}, {"5AAA", 2, 3, SignStyle.NORMAL, 1, 5}, // always {"5", 1, 2, SignStyle.ALWAYS, 1, 5}, {"5", 2, 2, SignStyle.ALWAYS, 1, 5}, {"54", 1, 3, SignStyle.ALWAYS, 2, 54}, {"54", 2, 3, SignStyle.ALWAYS, 2, 54}, {"54", 3, 3, SignStyle.ALWAYS, 2, 54}, {"543", 1, 3, SignStyle.ALWAYS, 3, 543}, {"543", 2, 3, SignStyle.ALWAYS, 3, 543}, {"543", 3, 3, SignStyle.ALWAYS, 3, 543}, {"5432", 1, 3, SignStyle.ALWAYS, 4, 5432}, {"5432", 2, 3, SignStyle.ALWAYS, 4, 5432}, {"5432", 3, 3, SignStyle.ALWAYS, 4, 5432}, {"5AAA", 2, 3, SignStyle.ALWAYS, 1, 5}, // exceeds pad {"5", 1, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"5", 2, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"54", 1, 3, SignStyle.EXCEEDS_PAD, 2, 54}, {"54", 2, 3, SignStyle.EXCEEDS_PAD, 2, 54}, {"54", 3, 3, SignStyle.EXCEEDS_PAD, 2, 54}, {"543", 1, 3, SignStyle.EXCEEDS_PAD, 3, 543}, {"543", 2, 3, SignStyle.EXCEEDS_PAD, 3, 543}, {"543", 3, 3, SignStyle.EXCEEDS_PAD, 3, 543}, {"5432", 1, 3, SignStyle.EXCEEDS_PAD, 4, 5432}, {"5432", 2, 3, SignStyle.EXCEEDS_PAD, 4, 5432}, {"5432", 3, 3, SignStyle.EXCEEDS_PAD, 4, 5432}, {"5AAA", 2, 3, SignStyle.EXCEEDS_PAD, 1, 5}, }; }
Example 7
Source File: TestNumberParser.java From hottub with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseData") Object[][] provider_parseData() { return new Object[][] { // normal {1, 2, SignStyle.NEVER, 0, "12", 0, 2, 12L}, // normal {1, 2, SignStyle.NEVER, 0, "Xxx12Xxx", 3, 5, 12L}, // parse in middle {1, 2, SignStyle.NEVER, 0, "99912999", 3, 5, 12L}, // parse in middle {2, 4, SignStyle.NEVER, 0, "12345", 0, 4, 1234L}, // stops at max width {2, 4, SignStyle.NEVER, 0, "12-45", 0, 2, 12L}, // stops at dash {2, 4, SignStyle.NEVER, 0, "123-5", 0, 3, 123L}, // stops at dash {1, 10, SignStyle.NORMAL, 0, "2147483647", 0, 10, Integer.MAX_VALUE}, {1, 10, SignStyle.NORMAL, 0, "-2147483648", 0, 11, Integer.MIN_VALUE}, {1, 10, SignStyle.NORMAL, 0, "2147483648", 0, 10, 2147483648L}, {1, 10, SignStyle.NORMAL, 0, "-2147483649", 0, 11, -2147483649L}, {1, 10, SignStyle.NORMAL, 0, "987659876598765", 0, 10, 9876598765L}, {1, 19, SignStyle.NORMAL, 0, "999999999999999999", 0, 18, 999999999999999999L}, {1, 19, SignStyle.NORMAL, 0, "-999999999999999999", 0, 19, -999999999999999999L}, {1, 19, SignStyle.NORMAL, 0, "1000000000000000000", 0, 19, 1000000000000000000L}, {1, 19, SignStyle.NORMAL, 0, "-1000000000000000000", 0, 20, -1000000000000000000L}, {1, 19, SignStyle.NORMAL, 0, "000000000000000000", 0, 18, 0L}, {1, 19, SignStyle.NORMAL, 0, "0000000000000000000", 0, 19, 0L}, {1, 19, SignStyle.NORMAL, 0, "9223372036854775807", 0, 19, Long.MAX_VALUE}, {1, 19, SignStyle.NORMAL, 0, "-9223372036854775808", 0, 20, Long.MIN_VALUE}, {1, 19, SignStyle.NORMAL, 0, "9223372036854775808", 0, 18, 922337203685477580L}, // last digit not parsed {1, 19, SignStyle.NORMAL, 0, "-9223372036854775809", 0, 19, -922337203685477580L}, // last digit not parsed // no match {1, 2, SignStyle.NEVER, 1, "A1", 0, 0, 0}, {1, 2, SignStyle.NEVER, 1, " 1", 0, 0, 0}, {1, 2, SignStyle.NEVER, 1, " 1", 1, 1, 0}, {2, 2, SignStyle.NEVER, 1, "1", 0, 0, 0}, {2, 2, SignStyle.NEVER, 1, "Xxx1", 0, 0, 0}, {2, 2, SignStyle.NEVER, 1, "1", 1, 1, 0}, {2, 2, SignStyle.NEVER, 1, "Xxx1", 4, 4, 0}, {2, 2, SignStyle.NEVER, 1, "1-2", 0, 0, 0}, {1, 19, SignStyle.NORMAL, 0, "-000000000000000000", 0, 0, 0}, {1, 19, SignStyle.NORMAL, 0, "-0000000000000000000", 0, 0, 0}, // parse reserving space 1 (adjacent-parsing) {1, 1, SignStyle.NEVER, 1, "12", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 1, "12", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 1, "12345", 0, 4, 1234L}, {1, 19, SignStyle.NEVER, 1, "12345678901", 0, 10, 1234567890L}, {1, 19, SignStyle.NEVER, 1, "123456789012345678901234567890", 0, 19, 1234567890123456789L}, {1, 19, SignStyle.NEVER, 1, "1", 0, 1, 1L}, // error from next field {2, 2, SignStyle.NEVER, 1, "12", 0, 2, 12L}, // error from next field {2, 19, SignStyle.NEVER, 1, "1", 0, 0, 0}, // parse reserving space 2 (adjacent-parsing) {1, 1, SignStyle.NEVER, 2, "123", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 2, "123", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 2, "12345", 0, 3, 123L}, {1, 19, SignStyle.NEVER, 2, "12345678901", 0, 9, 123456789L}, {1, 19, SignStyle.NEVER, 2, "123456789012345678901234567890", 0, 19, 1234567890123456789L}, {1, 19, SignStyle.NEVER, 2, "1", 0, 1, 1L}, // error from next field {1, 19, SignStyle.NEVER, 2, "12", 0, 1, 1L}, // error from next field {2, 2, SignStyle.NEVER, 2, "12", 0, 2, 12L}, // error from next field {2, 19, SignStyle.NEVER, 2, "1", 0, 0, 0}, {2, 19, SignStyle.NEVER, 2, "1AAAAABBBBBCCCCC", 0, 0, 0}, }; }
Example 8
Source File: TestNumberParser.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseSignsStrict") Object[][] provider_parseSignsStrict() { return new Object[][] { // basics {"0", 1, 2, SignStyle.NEVER, 1, 0}, {"1", 1, 2, SignStyle.NEVER, 1, 1}, {"2", 1, 2, SignStyle.NEVER, 1, 2}, {"3", 1, 2, SignStyle.NEVER, 1, 3}, {"4", 1, 2, SignStyle.NEVER, 1, 4}, {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"6", 1, 2, SignStyle.NEVER, 1, 6}, {"7", 1, 2, SignStyle.NEVER, 1, 7}, {"8", 1, 2, SignStyle.NEVER, 1, 8}, {"9", 1, 2, SignStyle.NEVER, 1, 9}, {"10", 1, 2, SignStyle.NEVER, 2, 10}, {"100", 1, 2, SignStyle.NEVER, 2, 10}, {"100", 1, 3, SignStyle.NEVER, 3, 100}, // never {"0", 1, 2, SignStyle.NEVER, 1, 0}, {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"50", 1, 2, SignStyle.NEVER, 2, 50}, {"500", 1, 2, SignStyle.NEVER, 2, 50}, {"-0", 1, 2, SignStyle.NEVER, 0, null}, {"-5", 1, 2, SignStyle.NEVER, 0, null}, {"-50", 1, 2, SignStyle.NEVER, 0, null}, {"-500", 1, 2, SignStyle.NEVER, 0, null}, {"-AAA", 1, 2, SignStyle.NEVER, 0, null}, {"+0", 1, 2, SignStyle.NEVER, 0, null}, {"+5", 1, 2, SignStyle.NEVER, 0, null}, {"+50", 1, 2, SignStyle.NEVER, 0, null}, {"+500", 1, 2, SignStyle.NEVER, 0, null}, {"+AAA", 1, 2, SignStyle.NEVER, 0, null}, // not negative {"0", 1, 2, SignStyle.NOT_NEGATIVE, 1, 0}, {"5", 1, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"50", 1, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"500", 1, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"-0", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-5", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-50", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-500", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-AAA", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+0", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+5", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+50", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+500", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+AAA", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, // normal {"0", 1, 2, SignStyle.NORMAL, 1, 0}, {"5", 1, 2, SignStyle.NORMAL, 1, 5}, {"50", 1, 2, SignStyle.NORMAL, 2, 50}, {"500", 1, 2, SignStyle.NORMAL, 2, 50}, {"-0", 1, 2, SignStyle.NORMAL, 0, null}, {"-5", 1, 2, SignStyle.NORMAL, 2, -5}, {"-50", 1, 2, SignStyle.NORMAL, 3, -50}, {"-500", 1, 2, SignStyle.NORMAL, 3, -50}, {"-AAA", 1, 2, SignStyle.NORMAL, 1, null}, {"+0", 1, 2, SignStyle.NORMAL, 0, null}, {"+5", 1, 2, SignStyle.NORMAL, 0, null}, {"+50", 1, 2, SignStyle.NORMAL, 0, null}, {"+500", 1, 2, SignStyle.NORMAL, 0, null}, {"+AAA", 1, 2, SignStyle.NORMAL, 0, null}, // always {"0", 1, 2, SignStyle.ALWAYS, 0, null}, {"5", 1, 2, SignStyle.ALWAYS, 0, null}, {"50", 1, 2, SignStyle.ALWAYS, 0, null}, {"500", 1, 2, SignStyle.ALWAYS, 0, null}, {"-0", 1, 2, SignStyle.ALWAYS, 0, null}, {"-5", 1, 2, SignStyle.ALWAYS, 2, -5}, {"-50", 1, 2, SignStyle.ALWAYS, 3, -50}, {"-500", 1, 2, SignStyle.ALWAYS, 3, -50}, {"-AAA", 1, 2, SignStyle.ALWAYS, 1, null}, {"+0", 1, 2, SignStyle.ALWAYS, 2, 0}, {"+5", 1, 2, SignStyle.ALWAYS, 2, 5}, {"+50", 1, 2, SignStyle.ALWAYS, 3, 50}, {"+500", 1, 2, SignStyle.ALWAYS, 3, 50}, {"+AAA", 1, 2, SignStyle.ALWAYS, 1, null}, // exceeds pad {"0", 1, 2, SignStyle.EXCEEDS_PAD, 1, 0}, {"5", 1, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"50", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"500", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"-0", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"-5", 1, 2, SignStyle.EXCEEDS_PAD, 2, -5}, {"-50", 1, 2, SignStyle.EXCEEDS_PAD, 3, -50}, {"-500", 1, 2, SignStyle.EXCEEDS_PAD, 3, -50}, {"-AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, {"+0", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"+5", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"+50", 1, 2, SignStyle.EXCEEDS_PAD, 3, 50}, {"+500", 1, 2, SignStyle.EXCEEDS_PAD, 3, 50}, {"+AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, }; }
Example 9
Source File: TestNumberParser.java From hottub with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseSignsLenient") Object[][] provider_parseSignsLenient() { return new Object[][] { // never {"0", 1, 2, SignStyle.NEVER, 1, 0}, {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"50", 1, 2, SignStyle.NEVER, 2, 50}, {"500", 1, 2, SignStyle.NEVER, 3, 500}, {"-0", 1, 2, SignStyle.NEVER, 2, 0}, {"-5", 1, 2, SignStyle.NEVER, 2, -5}, {"-50", 1, 2, SignStyle.NEVER, 3, -50}, {"-500", 1, 2, SignStyle.NEVER, 4, -500}, {"-AAA", 1, 2, SignStyle.NEVER, 1, null}, {"+0", 1, 2, SignStyle.NEVER, 2, 0}, {"+5", 1, 2, SignStyle.NEVER, 2, 5}, {"+50", 1, 2, SignStyle.NEVER, 3, 50}, {"+500", 1, 2, SignStyle.NEVER, 4, 500}, {"+AAA", 1, 2, SignStyle.NEVER, 1, null}, {"50", 2, 2, SignStyle.NEVER, 2, 50}, {"-50", 2, 2, SignStyle.NEVER, 0, null}, {"+50", 2, 2, SignStyle.NEVER, 0, null}, // not negative {"0", 1, 2, SignStyle.NOT_NEGATIVE, 1, 0}, {"5", 1, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"50", 1, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"500", 1, 2, SignStyle.NOT_NEGATIVE, 3, 500}, {"-0", 1, 2, SignStyle.NOT_NEGATIVE, 2, 0}, {"-5", 1, 2, SignStyle.NOT_NEGATIVE, 2, -5}, {"-50", 1, 2, SignStyle.NOT_NEGATIVE, 3, -50}, {"-500", 1, 2, SignStyle.NOT_NEGATIVE, 4, -500}, {"-AAA", 1, 2, SignStyle.NOT_NEGATIVE, 1, null}, {"+0", 1, 2, SignStyle.NOT_NEGATIVE, 2, 0}, {"+5", 1, 2, SignStyle.NOT_NEGATIVE, 2, 5}, {"+50", 1, 2, SignStyle.NOT_NEGATIVE, 3, 50}, {"+500", 1, 2, SignStyle.NOT_NEGATIVE, 4, 500}, {"+AAA", 1, 2, SignStyle.NOT_NEGATIVE, 1, null}, {"50", 2, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"-50", 2, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+50", 2, 2, SignStyle.NOT_NEGATIVE, 0, null}, // normal {"0", 1, 2, SignStyle.NORMAL, 1, 0}, {"5", 1, 2, SignStyle.NORMAL, 1, 5}, {"50", 1, 2, SignStyle.NORMAL, 2, 50}, {"500", 1, 2, SignStyle.NORMAL, 3, 500}, {"-0", 1, 2, SignStyle.NORMAL, 2, 0}, {"-5", 1, 2, SignStyle.NORMAL, 2, -5}, {"-50", 1, 2, SignStyle.NORMAL, 3, -50}, {"-500", 1, 2, SignStyle.NORMAL, 4, -500}, {"-AAA", 1, 2, SignStyle.NORMAL, 1, null}, {"+0", 1, 2, SignStyle.NORMAL, 2, 0}, {"+5", 1, 2, SignStyle.NORMAL, 2, 5}, {"+50", 1, 2, SignStyle.NORMAL, 3, 50}, {"+500", 1, 2, SignStyle.NORMAL, 4, 500}, {"+AAA", 1, 2, SignStyle.NORMAL, 1, null}, {"50", 2, 2, SignStyle.NORMAL, 2, 50}, {"-50", 2, 2, SignStyle.NORMAL, 3, -50}, {"+50", 2, 2, SignStyle.NORMAL, 3, 50}, // always {"0", 1, 2, SignStyle.ALWAYS, 1, 0}, {"5", 1, 2, SignStyle.ALWAYS, 1, 5}, {"50", 1, 2, SignStyle.ALWAYS, 2, 50}, {"500", 1, 2, SignStyle.ALWAYS, 3, 500}, {"-0", 1, 2, SignStyle.ALWAYS, 2, 0}, {"-5", 1, 2, SignStyle.ALWAYS, 2, -5}, {"-50", 1, 2, SignStyle.ALWAYS, 3, -50}, {"-500", 1, 2, SignStyle.ALWAYS, 4, -500}, {"-AAA", 1, 2, SignStyle.ALWAYS, 1, null}, {"+0", 1, 2, SignStyle.ALWAYS, 2, 0}, {"+5", 1, 2, SignStyle.ALWAYS, 2, 5}, {"+50", 1, 2, SignStyle.ALWAYS, 3, 50}, {"+500", 1, 2, SignStyle.ALWAYS, 4, 500}, {"+AAA", 1, 2, SignStyle.ALWAYS, 1, null}, // exceeds pad {"0", 1, 2, SignStyle.EXCEEDS_PAD, 1, 0}, {"5", 1, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"50", 1, 2, SignStyle.EXCEEDS_PAD, 2, 50}, {"500", 1, 2, SignStyle.EXCEEDS_PAD, 3, 500}, {"-0", 1, 2, SignStyle.EXCEEDS_PAD, 2, 0}, {"-5", 1, 2, SignStyle.EXCEEDS_PAD, 2, -5}, {"-50", 1, 2, SignStyle.EXCEEDS_PAD, 3, -50}, {"-500", 1, 2, SignStyle.EXCEEDS_PAD, 4, -500}, {"-AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, {"+0", 1, 2, SignStyle.EXCEEDS_PAD, 2, 0}, {"+5", 1, 2, SignStyle.EXCEEDS_PAD, 2, 5}, {"+50", 1, 2, SignStyle.EXCEEDS_PAD, 3, 50}, {"+500", 1, 2, SignStyle.EXCEEDS_PAD, 4, 500}, {"+AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, }; }
Example 10
Source File: TestNumberParser.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseData") Object[][] provider_parseData() { return new Object[][] { // normal {1, 2, SignStyle.NEVER, 0, "12", 0, 2, 12L}, // normal {1, 2, SignStyle.NEVER, 0, "Xxx12Xxx", 3, 5, 12L}, // parse in middle {1, 2, SignStyle.NEVER, 0, "99912999", 3, 5, 12L}, // parse in middle {2, 4, SignStyle.NEVER, 0, "12345", 0, 4, 1234L}, // stops at max width {2, 4, SignStyle.NEVER, 0, "12-45", 0, 2, 12L}, // stops at dash {2, 4, SignStyle.NEVER, 0, "123-5", 0, 3, 123L}, // stops at dash {1, 10, SignStyle.NORMAL, 0, "2147483647", 0, 10, Integer.MAX_VALUE}, {1, 10, SignStyle.NORMAL, 0, "-2147483648", 0, 11, Integer.MIN_VALUE}, {1, 10, SignStyle.NORMAL, 0, "2147483648", 0, 10, 2147483648L}, {1, 10, SignStyle.NORMAL, 0, "-2147483649", 0, 11, -2147483649L}, {1, 10, SignStyle.NORMAL, 0, "987659876598765", 0, 10, 9876598765L}, {1, 19, SignStyle.NORMAL, 0, "999999999999999999", 0, 18, 999999999999999999L}, {1, 19, SignStyle.NORMAL, 0, "-999999999999999999", 0, 19, -999999999999999999L}, {1, 19, SignStyle.NORMAL, 0, "1000000000000000000", 0, 19, 1000000000000000000L}, {1, 19, SignStyle.NORMAL, 0, "-1000000000000000000", 0, 20, -1000000000000000000L}, {1, 19, SignStyle.NORMAL, 0, "000000000000000000", 0, 18, 0L}, {1, 19, SignStyle.NORMAL, 0, "0000000000000000000", 0, 19, 0L}, {1, 19, SignStyle.NORMAL, 0, "9223372036854775807", 0, 19, Long.MAX_VALUE}, {1, 19, SignStyle.NORMAL, 0, "-9223372036854775808", 0, 20, Long.MIN_VALUE}, {1, 19, SignStyle.NORMAL, 0, "9223372036854775808", 0, 18, 922337203685477580L}, // last digit not parsed {1, 19, SignStyle.NORMAL, 0, "-9223372036854775809", 0, 19, -922337203685477580L}, // last digit not parsed // no match {1, 2, SignStyle.NEVER, 1, "A1", 0, 0, 0}, {1, 2, SignStyle.NEVER, 1, " 1", 0, 0, 0}, {1, 2, SignStyle.NEVER, 1, " 1", 1, 1, 0}, {2, 2, SignStyle.NEVER, 1, "1", 0, 0, 0}, {2, 2, SignStyle.NEVER, 1, "Xxx1", 0, 0, 0}, {2, 2, SignStyle.NEVER, 1, "1", 1, 1, 0}, {2, 2, SignStyle.NEVER, 1, "Xxx1", 4, 4, 0}, {2, 2, SignStyle.NEVER, 1, "1-2", 0, 0, 0}, {1, 19, SignStyle.NORMAL, 0, "-000000000000000000", 0, 0, 0}, {1, 19, SignStyle.NORMAL, 0, "-0000000000000000000", 0, 0, 0}, // parse reserving space 1 (adjacent-parsing) {1, 1, SignStyle.NEVER, 1, "12", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 1, "12", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 1, "12345", 0, 4, 1234L}, {1, 19, SignStyle.NEVER, 1, "12345678901", 0, 10, 1234567890L}, {1, 19, SignStyle.NEVER, 1, "123456789012345678901234567890", 0, 19, 1234567890123456789L}, {1, 19, SignStyle.NEVER, 1, "1", 0, 1, 1L}, // error from next field {2, 2, SignStyle.NEVER, 1, "12", 0, 2, 12L}, // error from next field {2, 19, SignStyle.NEVER, 1, "1", 0, 0, 0}, // parse reserving space 2 (adjacent-parsing) {1, 1, SignStyle.NEVER, 2, "123", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 2, "123", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 2, "12345", 0, 3, 123L}, {1, 19, SignStyle.NEVER, 2, "12345678901", 0, 9, 123456789L}, {1, 19, SignStyle.NEVER, 2, "123456789012345678901234567890", 0, 19, 1234567890123456789L}, {1, 19, SignStyle.NEVER, 2, "1", 0, 1, 1L}, // error from next field {1, 19, SignStyle.NEVER, 2, "12", 0, 1, 1L}, // error from next field {2, 2, SignStyle.NEVER, 2, "12", 0, 2, 12L}, // error from next field {2, 19, SignStyle.NEVER, 2, "1", 0, 0, 0}, {2, 19, SignStyle.NEVER, 2, "1AAAAABBBBBCCCCC", 0, 0, 0}, }; }
Example 11
Source File: TestNumberParser.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseSignsStrict") Object[][] provider_parseSignsStrict() { return new Object[][] { // basics {"0", 1, 2, SignStyle.NEVER, 1, 0}, {"1", 1, 2, SignStyle.NEVER, 1, 1}, {"2", 1, 2, SignStyle.NEVER, 1, 2}, {"3", 1, 2, SignStyle.NEVER, 1, 3}, {"4", 1, 2, SignStyle.NEVER, 1, 4}, {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"6", 1, 2, SignStyle.NEVER, 1, 6}, {"7", 1, 2, SignStyle.NEVER, 1, 7}, {"8", 1, 2, SignStyle.NEVER, 1, 8}, {"9", 1, 2, SignStyle.NEVER, 1, 9}, {"10", 1, 2, SignStyle.NEVER, 2, 10}, {"100", 1, 2, SignStyle.NEVER, 2, 10}, {"100", 1, 3, SignStyle.NEVER, 3, 100}, // never {"0", 1, 2, SignStyle.NEVER, 1, 0}, {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"50", 1, 2, SignStyle.NEVER, 2, 50}, {"500", 1, 2, SignStyle.NEVER, 2, 50}, {"-0", 1, 2, SignStyle.NEVER, 0, null}, {"-5", 1, 2, SignStyle.NEVER, 0, null}, {"-50", 1, 2, SignStyle.NEVER, 0, null}, {"-500", 1, 2, SignStyle.NEVER, 0, null}, {"-AAA", 1, 2, SignStyle.NEVER, 0, null}, {"+0", 1, 2, SignStyle.NEVER, 0, null}, {"+5", 1, 2, SignStyle.NEVER, 0, null}, {"+50", 1, 2, SignStyle.NEVER, 0, null}, {"+500", 1, 2, SignStyle.NEVER, 0, null}, {"+AAA", 1, 2, SignStyle.NEVER, 0, null}, // not negative {"0", 1, 2, SignStyle.NOT_NEGATIVE, 1, 0}, {"5", 1, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"50", 1, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"500", 1, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"-0", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-5", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-50", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-500", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-AAA", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+0", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+5", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+50", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+500", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+AAA", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, // normal {"0", 1, 2, SignStyle.NORMAL, 1, 0}, {"5", 1, 2, SignStyle.NORMAL, 1, 5}, {"50", 1, 2, SignStyle.NORMAL, 2, 50}, {"500", 1, 2, SignStyle.NORMAL, 2, 50}, {"-0", 1, 2, SignStyle.NORMAL, 0, null}, {"-5", 1, 2, SignStyle.NORMAL, 2, -5}, {"-50", 1, 2, SignStyle.NORMAL, 3, -50}, {"-500", 1, 2, SignStyle.NORMAL, 3, -50}, {"-AAA", 1, 2, SignStyle.NORMAL, 1, null}, {"+0", 1, 2, SignStyle.NORMAL, 0, null}, {"+5", 1, 2, SignStyle.NORMAL, 0, null}, {"+50", 1, 2, SignStyle.NORMAL, 0, null}, {"+500", 1, 2, SignStyle.NORMAL, 0, null}, {"+AAA", 1, 2, SignStyle.NORMAL, 0, null}, // always {"0", 1, 2, SignStyle.ALWAYS, 0, null}, {"5", 1, 2, SignStyle.ALWAYS, 0, null}, {"50", 1, 2, SignStyle.ALWAYS, 0, null}, {"500", 1, 2, SignStyle.ALWAYS, 0, null}, {"-0", 1, 2, SignStyle.ALWAYS, 0, null}, {"-5", 1, 2, SignStyle.ALWAYS, 2, -5}, {"-50", 1, 2, SignStyle.ALWAYS, 3, -50}, {"-500", 1, 2, SignStyle.ALWAYS, 3, -50}, {"-AAA", 1, 2, SignStyle.ALWAYS, 1, null}, {"+0", 1, 2, SignStyle.ALWAYS, 2, 0}, {"+5", 1, 2, SignStyle.ALWAYS, 2, 5}, {"+50", 1, 2, SignStyle.ALWAYS, 3, 50}, {"+500", 1, 2, SignStyle.ALWAYS, 3, 50}, {"+AAA", 1, 2, SignStyle.ALWAYS, 1, null}, // exceeds pad {"0", 1, 2, SignStyle.EXCEEDS_PAD, 1, 0}, {"5", 1, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"50", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"500", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"-0", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"-5", 1, 2, SignStyle.EXCEEDS_PAD, 2, -5}, {"-50", 1, 2, SignStyle.EXCEEDS_PAD, 3, -50}, {"-500", 1, 2, SignStyle.EXCEEDS_PAD, 3, -50}, {"-AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, {"+0", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"+5", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"+50", 1, 2, SignStyle.EXCEEDS_PAD, 3, 50}, {"+500", 1, 2, SignStyle.EXCEEDS_PAD, 3, 50}, {"+AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, }; }
Example 12
Source File: TestNumberParser.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseData") Object[][] provider_parseData() { return new Object[][] { // normal {1, 2, SignStyle.NEVER, 0, "12", 0, 2, 12L}, // normal {1, 2, SignStyle.NEVER, 0, "Xxx12Xxx", 3, 5, 12L}, // parse in middle {1, 2, SignStyle.NEVER, 0, "99912999", 3, 5, 12L}, // parse in middle {2, 4, SignStyle.NEVER, 0, "12345", 0, 4, 1234L}, // stops at max width {2, 4, SignStyle.NEVER, 0, "12-45", 0, 2, 12L}, // stops at dash {2, 4, SignStyle.NEVER, 0, "123-5", 0, 3, 123L}, // stops at dash {1, 10, SignStyle.NORMAL, 0, "2147483647", 0, 10, Integer.MAX_VALUE}, {1, 10, SignStyle.NORMAL, 0, "-2147483648", 0, 11, Integer.MIN_VALUE}, {1, 10, SignStyle.NORMAL, 0, "2147483648", 0, 10, 2147483648L}, {1, 10, SignStyle.NORMAL, 0, "-2147483649", 0, 11, -2147483649L}, {1, 10, SignStyle.NORMAL, 0, "987659876598765", 0, 10, 9876598765L}, {1, 19, SignStyle.NORMAL, 0, "999999999999999999", 0, 18, 999999999999999999L}, {1, 19, SignStyle.NORMAL, 0, "-999999999999999999", 0, 19, -999999999999999999L}, {1, 19, SignStyle.NORMAL, 0, "1000000000000000000", 0, 19, 1000000000000000000L}, {1, 19, SignStyle.NORMAL, 0, "-1000000000000000000", 0, 20, -1000000000000000000L}, {1, 19, SignStyle.NORMAL, 0, "000000000000000000", 0, 18, 0L}, {1, 19, SignStyle.NORMAL, 0, "0000000000000000000", 0, 19, 0L}, {1, 19, SignStyle.NORMAL, 0, "9223372036854775807", 0, 19, Long.MAX_VALUE}, {1, 19, SignStyle.NORMAL, 0, "-9223372036854775808", 0, 20, Long.MIN_VALUE}, {1, 19, SignStyle.NORMAL, 0, "9223372036854775808", 0, 18, 922337203685477580L}, // last digit not parsed {1, 19, SignStyle.NORMAL, 0, "-9223372036854775809", 0, 19, -922337203685477580L}, // last digit not parsed // no match {1, 2, SignStyle.NEVER, 1, "A1", 0, 0, 0}, {1, 2, SignStyle.NEVER, 1, " 1", 0, 0, 0}, {1, 2, SignStyle.NEVER, 1, " 1", 1, 1, 0}, {2, 2, SignStyle.NEVER, 1, "1", 0, 0, 0}, {2, 2, SignStyle.NEVER, 1, "Xxx1", 0, 0, 0}, {2, 2, SignStyle.NEVER, 1, "1", 1, 1, 0}, {2, 2, SignStyle.NEVER, 1, "Xxx1", 4, 4, 0}, {2, 2, SignStyle.NEVER, 1, "1-2", 0, 0, 0}, {1, 19, SignStyle.NORMAL, 0, "-000000000000000000", 0, 0, 0}, {1, 19, SignStyle.NORMAL, 0, "-0000000000000000000", 0, 0, 0}, // parse reserving space 1 (adjacent-parsing) {1, 1, SignStyle.NEVER, 1, "12", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 1, "12", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 1, "12345", 0, 4, 1234L}, {1, 19, SignStyle.NEVER, 1, "12345678901", 0, 10, 1234567890L}, {1, 19, SignStyle.NEVER, 1, "123456789012345678901234567890", 0, 19, 1234567890123456789L}, {1, 19, SignStyle.NEVER, 1, "1", 0, 1, 1L}, // error from next field {2, 2, SignStyle.NEVER, 1, "12", 0, 2, 12L}, // error from next field {2, 19, SignStyle.NEVER, 1, "1", 0, 0, 0}, // parse reserving space 2 (adjacent-parsing) {1, 1, SignStyle.NEVER, 2, "123", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 2, "123", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 2, "12345", 0, 3, 123L}, {1, 19, SignStyle.NEVER, 2, "12345678901", 0, 9, 123456789L}, {1, 19, SignStyle.NEVER, 2, "123456789012345678901234567890", 0, 19, 1234567890123456789L}, {1, 19, SignStyle.NEVER, 2, "1", 0, 1, 1L}, // error from next field {1, 19, SignStyle.NEVER, 2, "12", 0, 1, 1L}, // error from next field {2, 2, SignStyle.NEVER, 2, "12", 0, 2, 12L}, // error from next field {2, 19, SignStyle.NEVER, 2, "1", 0, 0, 0}, {2, 19, SignStyle.NEVER, 2, "1AAAAABBBBBCCCCC", 0, 0, 0}, }; }
Example 13
Source File: TestNumberParser.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseSignsStrict") Object[][] provider_parseSignsStrict() { return new Object[][] { // basics {"0", 1, 2, SignStyle.NEVER, 1, 0}, {"1", 1, 2, SignStyle.NEVER, 1, 1}, {"2", 1, 2, SignStyle.NEVER, 1, 2}, {"3", 1, 2, SignStyle.NEVER, 1, 3}, {"4", 1, 2, SignStyle.NEVER, 1, 4}, {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"6", 1, 2, SignStyle.NEVER, 1, 6}, {"7", 1, 2, SignStyle.NEVER, 1, 7}, {"8", 1, 2, SignStyle.NEVER, 1, 8}, {"9", 1, 2, SignStyle.NEVER, 1, 9}, {"10", 1, 2, SignStyle.NEVER, 2, 10}, {"100", 1, 2, SignStyle.NEVER, 2, 10}, {"100", 1, 3, SignStyle.NEVER, 3, 100}, // never {"0", 1, 2, SignStyle.NEVER, 1, 0}, {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"50", 1, 2, SignStyle.NEVER, 2, 50}, {"500", 1, 2, SignStyle.NEVER, 2, 50}, {"-0", 1, 2, SignStyle.NEVER, 0, null}, {"-5", 1, 2, SignStyle.NEVER, 0, null}, {"-50", 1, 2, SignStyle.NEVER, 0, null}, {"-500", 1, 2, SignStyle.NEVER, 0, null}, {"-AAA", 1, 2, SignStyle.NEVER, 0, null}, {"+0", 1, 2, SignStyle.NEVER, 0, null}, {"+5", 1, 2, SignStyle.NEVER, 0, null}, {"+50", 1, 2, SignStyle.NEVER, 0, null}, {"+500", 1, 2, SignStyle.NEVER, 0, null}, {"+AAA", 1, 2, SignStyle.NEVER, 0, null}, // not negative {"0", 1, 2, SignStyle.NOT_NEGATIVE, 1, 0}, {"5", 1, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"50", 1, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"500", 1, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"-0", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-5", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-50", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-500", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-AAA", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+0", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+5", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+50", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+500", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+AAA", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, // normal {"0", 1, 2, SignStyle.NORMAL, 1, 0}, {"5", 1, 2, SignStyle.NORMAL, 1, 5}, {"50", 1, 2, SignStyle.NORMAL, 2, 50}, {"500", 1, 2, SignStyle.NORMAL, 2, 50}, {"-0", 1, 2, SignStyle.NORMAL, 0, null}, {"-5", 1, 2, SignStyle.NORMAL, 2, -5}, {"-50", 1, 2, SignStyle.NORMAL, 3, -50}, {"-500", 1, 2, SignStyle.NORMAL, 3, -50}, {"-AAA", 1, 2, SignStyle.NORMAL, 1, null}, {"+0", 1, 2, SignStyle.NORMAL, 0, null}, {"+5", 1, 2, SignStyle.NORMAL, 0, null}, {"+50", 1, 2, SignStyle.NORMAL, 0, null}, {"+500", 1, 2, SignStyle.NORMAL, 0, null}, {"+AAA", 1, 2, SignStyle.NORMAL, 0, null}, // always {"0", 1, 2, SignStyle.ALWAYS, 0, null}, {"5", 1, 2, SignStyle.ALWAYS, 0, null}, {"50", 1, 2, SignStyle.ALWAYS, 0, null}, {"500", 1, 2, SignStyle.ALWAYS, 0, null}, {"-0", 1, 2, SignStyle.ALWAYS, 0, null}, {"-5", 1, 2, SignStyle.ALWAYS, 2, -5}, {"-50", 1, 2, SignStyle.ALWAYS, 3, -50}, {"-500", 1, 2, SignStyle.ALWAYS, 3, -50}, {"-AAA", 1, 2, SignStyle.ALWAYS, 1, null}, {"+0", 1, 2, SignStyle.ALWAYS, 2, 0}, {"+5", 1, 2, SignStyle.ALWAYS, 2, 5}, {"+50", 1, 2, SignStyle.ALWAYS, 3, 50}, {"+500", 1, 2, SignStyle.ALWAYS, 3, 50}, {"+AAA", 1, 2, SignStyle.ALWAYS, 1, null}, // exceeds pad {"0", 1, 2, SignStyle.EXCEEDS_PAD, 1, 0}, {"5", 1, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"50", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"500", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"-0", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"-5", 1, 2, SignStyle.EXCEEDS_PAD, 2, -5}, {"-50", 1, 2, SignStyle.EXCEEDS_PAD, 3, -50}, {"-500", 1, 2, SignStyle.EXCEEDS_PAD, 3, -50}, {"-AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, {"+0", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"+5", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"+50", 1, 2, SignStyle.EXCEEDS_PAD, 3, 50}, {"+500", 1, 2, SignStyle.EXCEEDS_PAD, 3, 50}, {"+AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, }; }
Example 14
Source File: TestNumberParser.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseSignsLenient") Object[][] provider_parseSignsLenient() { return new Object[][] { // never {"0", 1, 2, SignStyle.NEVER, 1, 0}, {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"50", 1, 2, SignStyle.NEVER, 2, 50}, {"500", 1, 2, SignStyle.NEVER, 3, 500}, {"-0", 1, 2, SignStyle.NEVER, 2, 0}, {"-5", 1, 2, SignStyle.NEVER, 2, -5}, {"-50", 1, 2, SignStyle.NEVER, 3, -50}, {"-500", 1, 2, SignStyle.NEVER, 4, -500}, {"-AAA", 1, 2, SignStyle.NEVER, 1, null}, {"+0", 1, 2, SignStyle.NEVER, 2, 0}, {"+5", 1, 2, SignStyle.NEVER, 2, 5}, {"+50", 1, 2, SignStyle.NEVER, 3, 50}, {"+500", 1, 2, SignStyle.NEVER, 4, 500}, {"+AAA", 1, 2, SignStyle.NEVER, 1, null}, {"50", 2, 2, SignStyle.NEVER, 2, 50}, {"-50", 2, 2, SignStyle.NEVER, 0, null}, {"+50", 2, 2, SignStyle.NEVER, 0, null}, // not negative {"0", 1, 2, SignStyle.NOT_NEGATIVE, 1, 0}, {"5", 1, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"50", 1, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"500", 1, 2, SignStyle.NOT_NEGATIVE, 3, 500}, {"-0", 1, 2, SignStyle.NOT_NEGATIVE, 2, 0}, {"-5", 1, 2, SignStyle.NOT_NEGATIVE, 2, -5}, {"-50", 1, 2, SignStyle.NOT_NEGATIVE, 3, -50}, {"-500", 1, 2, SignStyle.NOT_NEGATIVE, 4, -500}, {"-AAA", 1, 2, SignStyle.NOT_NEGATIVE, 1, null}, {"+0", 1, 2, SignStyle.NOT_NEGATIVE, 2, 0}, {"+5", 1, 2, SignStyle.NOT_NEGATIVE, 2, 5}, {"+50", 1, 2, SignStyle.NOT_NEGATIVE, 3, 50}, {"+500", 1, 2, SignStyle.NOT_NEGATIVE, 4, 500}, {"+AAA", 1, 2, SignStyle.NOT_NEGATIVE, 1, null}, {"50", 2, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"-50", 2, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+50", 2, 2, SignStyle.NOT_NEGATIVE, 0, null}, // normal {"0", 1, 2, SignStyle.NORMAL, 1, 0}, {"5", 1, 2, SignStyle.NORMAL, 1, 5}, {"50", 1, 2, SignStyle.NORMAL, 2, 50}, {"500", 1, 2, SignStyle.NORMAL, 3, 500}, {"-0", 1, 2, SignStyle.NORMAL, 2, 0}, {"-5", 1, 2, SignStyle.NORMAL, 2, -5}, {"-50", 1, 2, SignStyle.NORMAL, 3, -50}, {"-500", 1, 2, SignStyle.NORMAL, 4, -500}, {"-AAA", 1, 2, SignStyle.NORMAL, 1, null}, {"+0", 1, 2, SignStyle.NORMAL, 2, 0}, {"+5", 1, 2, SignStyle.NORMAL, 2, 5}, {"+50", 1, 2, SignStyle.NORMAL, 3, 50}, {"+500", 1, 2, SignStyle.NORMAL, 4, 500}, {"+AAA", 1, 2, SignStyle.NORMAL, 1, null}, {"50", 2, 2, SignStyle.NORMAL, 2, 50}, {"-50", 2, 2, SignStyle.NORMAL, 3, -50}, {"+50", 2, 2, SignStyle.NORMAL, 3, 50}, // always {"0", 1, 2, SignStyle.ALWAYS, 1, 0}, {"5", 1, 2, SignStyle.ALWAYS, 1, 5}, {"50", 1, 2, SignStyle.ALWAYS, 2, 50}, {"500", 1, 2, SignStyle.ALWAYS, 3, 500}, {"-0", 1, 2, SignStyle.ALWAYS, 2, 0}, {"-5", 1, 2, SignStyle.ALWAYS, 2, -5}, {"-50", 1, 2, SignStyle.ALWAYS, 3, -50}, {"-500", 1, 2, SignStyle.ALWAYS, 4, -500}, {"-AAA", 1, 2, SignStyle.ALWAYS, 1, null}, {"+0", 1, 2, SignStyle.ALWAYS, 2, 0}, {"+5", 1, 2, SignStyle.ALWAYS, 2, 5}, {"+50", 1, 2, SignStyle.ALWAYS, 3, 50}, {"+500", 1, 2, SignStyle.ALWAYS, 4, 500}, {"+AAA", 1, 2, SignStyle.ALWAYS, 1, null}, // exceeds pad {"0", 1, 2, SignStyle.EXCEEDS_PAD, 1, 0}, {"5", 1, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"50", 1, 2, SignStyle.EXCEEDS_PAD, 2, 50}, {"500", 1, 2, SignStyle.EXCEEDS_PAD, 3, 500}, {"-0", 1, 2, SignStyle.EXCEEDS_PAD, 2, 0}, {"-5", 1, 2, SignStyle.EXCEEDS_PAD, 2, -5}, {"-50", 1, 2, SignStyle.EXCEEDS_PAD, 3, -50}, {"-500", 1, 2, SignStyle.EXCEEDS_PAD, 4, -500}, {"-AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, {"+0", 1, 2, SignStyle.EXCEEDS_PAD, 2, 0}, {"+5", 1, 2, SignStyle.EXCEEDS_PAD, 2, 5}, {"+50", 1, 2, SignStyle.EXCEEDS_PAD, 3, 50}, {"+500", 1, 2, SignStyle.EXCEEDS_PAD, 4, 500}, {"+AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, }; }
Example 15
Source File: TestNumberParser.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseSignsStrict") Object[][] provider_parseSignsStrict() { return new Object[][] { // basics {"0", 1, 2, SignStyle.NEVER, 1, 0}, {"1", 1, 2, SignStyle.NEVER, 1, 1}, {"2", 1, 2, SignStyle.NEVER, 1, 2}, {"3", 1, 2, SignStyle.NEVER, 1, 3}, {"4", 1, 2, SignStyle.NEVER, 1, 4}, {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"6", 1, 2, SignStyle.NEVER, 1, 6}, {"7", 1, 2, SignStyle.NEVER, 1, 7}, {"8", 1, 2, SignStyle.NEVER, 1, 8}, {"9", 1, 2, SignStyle.NEVER, 1, 9}, {"10", 1, 2, SignStyle.NEVER, 2, 10}, {"100", 1, 2, SignStyle.NEVER, 2, 10}, {"100", 1, 3, SignStyle.NEVER, 3, 100}, // never {"0", 1, 2, SignStyle.NEVER, 1, 0}, {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"50", 1, 2, SignStyle.NEVER, 2, 50}, {"500", 1, 2, SignStyle.NEVER, 2, 50}, {"-0", 1, 2, SignStyle.NEVER, 0, null}, {"-5", 1, 2, SignStyle.NEVER, 0, null}, {"-50", 1, 2, SignStyle.NEVER, 0, null}, {"-500", 1, 2, SignStyle.NEVER, 0, null}, {"-AAA", 1, 2, SignStyle.NEVER, 0, null}, {"+0", 1, 2, SignStyle.NEVER, 0, null}, {"+5", 1, 2, SignStyle.NEVER, 0, null}, {"+50", 1, 2, SignStyle.NEVER, 0, null}, {"+500", 1, 2, SignStyle.NEVER, 0, null}, {"+AAA", 1, 2, SignStyle.NEVER, 0, null}, // not negative {"0", 1, 2, SignStyle.NOT_NEGATIVE, 1, 0}, {"5", 1, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"50", 1, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"500", 1, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"-0", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-5", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-50", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-500", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"-AAA", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+0", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+5", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+50", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+500", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+AAA", 1, 2, SignStyle.NOT_NEGATIVE, 0, null}, // normal {"0", 1, 2, SignStyle.NORMAL, 1, 0}, {"5", 1, 2, SignStyle.NORMAL, 1, 5}, {"50", 1, 2, SignStyle.NORMAL, 2, 50}, {"500", 1, 2, SignStyle.NORMAL, 2, 50}, {"-0", 1, 2, SignStyle.NORMAL, 0, null}, {"-5", 1, 2, SignStyle.NORMAL, 2, -5}, {"-50", 1, 2, SignStyle.NORMAL, 3, -50}, {"-500", 1, 2, SignStyle.NORMAL, 3, -50}, {"-AAA", 1, 2, SignStyle.NORMAL, 1, null}, {"+0", 1, 2, SignStyle.NORMAL, 0, null}, {"+5", 1, 2, SignStyle.NORMAL, 0, null}, {"+50", 1, 2, SignStyle.NORMAL, 0, null}, {"+500", 1, 2, SignStyle.NORMAL, 0, null}, {"+AAA", 1, 2, SignStyle.NORMAL, 0, null}, // always {"0", 1, 2, SignStyle.ALWAYS, 0, null}, {"5", 1, 2, SignStyle.ALWAYS, 0, null}, {"50", 1, 2, SignStyle.ALWAYS, 0, null}, {"500", 1, 2, SignStyle.ALWAYS, 0, null}, {"-0", 1, 2, SignStyle.ALWAYS, 0, null}, {"-5", 1, 2, SignStyle.ALWAYS, 2, -5}, {"-50", 1, 2, SignStyle.ALWAYS, 3, -50}, {"-500", 1, 2, SignStyle.ALWAYS, 3, -50}, {"-AAA", 1, 2, SignStyle.ALWAYS, 1, null}, {"+0", 1, 2, SignStyle.ALWAYS, 2, 0}, {"+5", 1, 2, SignStyle.ALWAYS, 2, 5}, {"+50", 1, 2, SignStyle.ALWAYS, 3, 50}, {"+500", 1, 2, SignStyle.ALWAYS, 3, 50}, {"+AAA", 1, 2, SignStyle.ALWAYS, 1, null}, // exceeds pad {"0", 1, 2, SignStyle.EXCEEDS_PAD, 1, 0}, {"5", 1, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"50", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"500", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"-0", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"-5", 1, 2, SignStyle.EXCEEDS_PAD, 2, -5}, {"-50", 1, 2, SignStyle.EXCEEDS_PAD, 3, -50}, {"-500", 1, 2, SignStyle.EXCEEDS_PAD, 3, -50}, {"-AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, {"+0", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"+5", 1, 2, SignStyle.EXCEEDS_PAD, 0, null}, {"+50", 1, 2, SignStyle.EXCEEDS_PAD, 3, 50}, {"+500", 1, 2, SignStyle.EXCEEDS_PAD, 3, 50}, {"+AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, }; }
Example 16
Source File: TestNumberParser.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseData") Object[][] provider_parseData() { return new Object[][] { // normal {1, 2, SignStyle.NEVER, 0, "12", 0, 2, 12L}, // normal {1, 2, SignStyle.NEVER, 0, "Xxx12Xxx", 3, 5, 12L}, // parse in middle {1, 2, SignStyle.NEVER, 0, "99912999", 3, 5, 12L}, // parse in middle {2, 4, SignStyle.NEVER, 0, "12345", 0, 4, 1234L}, // stops at max width {2, 4, SignStyle.NEVER, 0, "12-45", 0, 2, 12L}, // stops at dash {2, 4, SignStyle.NEVER, 0, "123-5", 0, 3, 123L}, // stops at dash {1, 10, SignStyle.NORMAL, 0, "2147483647", 0, 10, Integer.MAX_VALUE}, {1, 10, SignStyle.NORMAL, 0, "-2147483648", 0, 11, Integer.MIN_VALUE}, {1, 10, SignStyle.NORMAL, 0, "2147483648", 0, 10, 2147483648L}, {1, 10, SignStyle.NORMAL, 0, "-2147483649", 0, 11, -2147483649L}, {1, 10, SignStyle.NORMAL, 0, "987659876598765", 0, 10, 9876598765L}, {1, 19, SignStyle.NORMAL, 0, "999999999999999999", 0, 18, 999999999999999999L}, {1, 19, SignStyle.NORMAL, 0, "-999999999999999999", 0, 19, -999999999999999999L}, {1, 19, SignStyle.NORMAL, 0, "1000000000000000000", 0, 19, 1000000000000000000L}, {1, 19, SignStyle.NORMAL, 0, "-1000000000000000000", 0, 20, -1000000000000000000L}, {1, 19, SignStyle.NORMAL, 0, "000000000000000000", 0, 18, 0L}, {1, 19, SignStyle.NORMAL, 0, "0000000000000000000", 0, 19, 0L}, {1, 19, SignStyle.NORMAL, 0, "9223372036854775807", 0, 19, Long.MAX_VALUE}, {1, 19, SignStyle.NORMAL, 0, "-9223372036854775808", 0, 20, Long.MIN_VALUE}, {1, 19, SignStyle.NORMAL, 0, "9223372036854775808", 0, 18, 922337203685477580L}, // last digit not parsed {1, 19, SignStyle.NORMAL, 0, "-9223372036854775809", 0, 19, -922337203685477580L}, // last digit not parsed // no match {1, 2, SignStyle.NEVER, 1, "A1", 0, 0, 0}, {1, 2, SignStyle.NEVER, 1, " 1", 0, 0, 0}, {1, 2, SignStyle.NEVER, 1, " 1", 1, 1, 0}, {2, 2, SignStyle.NEVER, 1, "1", 0, 0, 0}, {2, 2, SignStyle.NEVER, 1, "Xxx1", 0, 0, 0}, {2, 2, SignStyle.NEVER, 1, "1", 1, 1, 0}, {2, 2, SignStyle.NEVER, 1, "Xxx1", 4, 4, 0}, {2, 2, SignStyle.NEVER, 1, "1-2", 0, 0, 0}, {1, 19, SignStyle.NORMAL, 0, "-000000000000000000", 0, 0, 0}, {1, 19, SignStyle.NORMAL, 0, "-0000000000000000000", 0, 0, 0}, // parse reserving space 1 (adjacent-parsing) {1, 1, SignStyle.NEVER, 1, "12", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 1, "12", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 1, "12345", 0, 4, 1234L}, {1, 19, SignStyle.NEVER, 1, "12345678901", 0, 10, 1234567890L}, {1, 19, SignStyle.NEVER, 1, "123456789012345678901234567890", 0, 19, 1234567890123456789L}, {1, 19, SignStyle.NEVER, 1, "1", 0, 1, 1L}, // error from next field {2, 2, SignStyle.NEVER, 1, "12", 0, 2, 12L}, // error from next field {2, 19, SignStyle.NEVER, 1, "1", 0, 0, 0}, // parse reserving space 2 (adjacent-parsing) {1, 1, SignStyle.NEVER, 2, "123", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 2, "123", 0, 1, 1L}, {1, 19, SignStyle.NEVER, 2, "12345", 0, 3, 123L}, {1, 19, SignStyle.NEVER, 2, "12345678901", 0, 9, 123456789L}, {1, 19, SignStyle.NEVER, 2, "123456789012345678901234567890", 0, 19, 1234567890123456789L}, {1, 19, SignStyle.NEVER, 2, "1", 0, 1, 1L}, // error from next field {1, 19, SignStyle.NEVER, 2, "12", 0, 1, 1L}, // error from next field {2, 2, SignStyle.NEVER, 2, "12", 0, 2, 12L}, // error from next field {2, 19, SignStyle.NEVER, 2, "1", 0, 0, 0}, {2, 19, SignStyle.NEVER, 2, "1AAAAABBBBBCCCCC", 0, 0, 0}, }; }
Example 17
Source File: TestNumberParser.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseDigitsLenient") Object[][] provider_parseDigitsLenient() { return new Object[][] { // never {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"5", 2, 2, SignStyle.NEVER, 1, 5}, {"54", 1, 3, SignStyle.NEVER, 2, 54}, {"54", 2, 3, SignStyle.NEVER, 2, 54}, {"54", 3, 3, SignStyle.NEVER, 2, 54}, {"543", 1, 3, SignStyle.NEVER, 3, 543}, {"543", 2, 3, SignStyle.NEVER, 3, 543}, {"543", 3, 3, SignStyle.NEVER, 3, 543}, {"5432", 1, 3, SignStyle.NEVER, 4, 5432}, {"5432", 2, 3, SignStyle.NEVER, 4, 5432}, {"5432", 3, 3, SignStyle.NEVER, 4, 5432}, {"5AAA", 2, 3, SignStyle.NEVER, 1, 5}, // not negative {"5", 1, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"5", 2, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"54", 1, 3, SignStyle.NOT_NEGATIVE, 2, 54}, {"54", 2, 3, SignStyle.NOT_NEGATIVE, 2, 54}, {"54", 3, 3, SignStyle.NOT_NEGATIVE, 2, 54}, {"543", 1, 3, SignStyle.NOT_NEGATIVE, 3, 543}, {"543", 2, 3, SignStyle.NOT_NEGATIVE, 3, 543}, {"543", 3, 3, SignStyle.NOT_NEGATIVE, 3, 543}, {"5432", 1, 3, SignStyle.NOT_NEGATIVE, 4, 5432}, {"5432", 2, 3, SignStyle.NOT_NEGATIVE, 4, 5432}, {"5432", 3, 3, SignStyle.NOT_NEGATIVE, 4, 5432}, {"5AAA", 2, 3, SignStyle.NOT_NEGATIVE, 1, 5}, // normal {"5", 1, 2, SignStyle.NORMAL, 1, 5}, {"5", 2, 2, SignStyle.NORMAL, 1, 5}, {"54", 1, 3, SignStyle.NORMAL, 2, 54}, {"54", 2, 3, SignStyle.NORMAL, 2, 54}, {"54", 3, 3, SignStyle.NORMAL, 2, 54}, {"543", 1, 3, SignStyle.NORMAL, 3, 543}, {"543", 2, 3, SignStyle.NORMAL, 3, 543}, {"543", 3, 3, SignStyle.NORMAL, 3, 543}, {"5432", 1, 3, SignStyle.NORMAL, 4, 5432}, {"5432", 2, 3, SignStyle.NORMAL, 4, 5432}, {"5432", 3, 3, SignStyle.NORMAL, 4, 5432}, {"5AAA", 2, 3, SignStyle.NORMAL, 1, 5}, // always {"5", 1, 2, SignStyle.ALWAYS, 1, 5}, {"5", 2, 2, SignStyle.ALWAYS, 1, 5}, {"54", 1, 3, SignStyle.ALWAYS, 2, 54}, {"54", 2, 3, SignStyle.ALWAYS, 2, 54}, {"54", 3, 3, SignStyle.ALWAYS, 2, 54}, {"543", 1, 3, SignStyle.ALWAYS, 3, 543}, {"543", 2, 3, SignStyle.ALWAYS, 3, 543}, {"543", 3, 3, SignStyle.ALWAYS, 3, 543}, {"5432", 1, 3, SignStyle.ALWAYS, 4, 5432}, {"5432", 2, 3, SignStyle.ALWAYS, 4, 5432}, {"5432", 3, 3, SignStyle.ALWAYS, 4, 5432}, {"5AAA", 2, 3, SignStyle.ALWAYS, 1, 5}, // exceeds pad {"5", 1, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"5", 2, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"54", 1, 3, SignStyle.EXCEEDS_PAD, 2, 54}, {"54", 2, 3, SignStyle.EXCEEDS_PAD, 2, 54}, {"54", 3, 3, SignStyle.EXCEEDS_PAD, 2, 54}, {"543", 1, 3, SignStyle.EXCEEDS_PAD, 3, 543}, {"543", 2, 3, SignStyle.EXCEEDS_PAD, 3, 543}, {"543", 3, 3, SignStyle.EXCEEDS_PAD, 3, 543}, {"5432", 1, 3, SignStyle.EXCEEDS_PAD, 4, 5432}, {"5432", 2, 3, SignStyle.EXCEEDS_PAD, 4, 5432}, {"5432", 3, 3, SignStyle.EXCEEDS_PAD, 4, 5432}, {"5AAA", 2, 3, SignStyle.EXCEEDS_PAD, 1, 5}, }; }
Example 18
Source File: TestNumberParser.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseSignsLenient") Object[][] provider_parseSignsLenient() { return new Object[][] { // never {"0", 1, 2, SignStyle.NEVER, 1, 0}, {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"50", 1, 2, SignStyle.NEVER, 2, 50}, {"500", 1, 2, SignStyle.NEVER, 3, 500}, {"-0", 1, 2, SignStyle.NEVER, 2, 0}, {"-5", 1, 2, SignStyle.NEVER, 2, -5}, {"-50", 1, 2, SignStyle.NEVER, 3, -50}, {"-500", 1, 2, SignStyle.NEVER, 4, -500}, {"-AAA", 1, 2, SignStyle.NEVER, 1, null}, {"+0", 1, 2, SignStyle.NEVER, 2, 0}, {"+5", 1, 2, SignStyle.NEVER, 2, 5}, {"+50", 1, 2, SignStyle.NEVER, 3, 50}, {"+500", 1, 2, SignStyle.NEVER, 4, 500}, {"+AAA", 1, 2, SignStyle.NEVER, 1, null}, {"50", 2, 2, SignStyle.NEVER, 2, 50}, {"-50", 2, 2, SignStyle.NEVER, 0, null}, {"+50", 2, 2, SignStyle.NEVER, 0, null}, // not negative {"0", 1, 2, SignStyle.NOT_NEGATIVE, 1, 0}, {"5", 1, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"50", 1, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"500", 1, 2, SignStyle.NOT_NEGATIVE, 3, 500}, {"-0", 1, 2, SignStyle.NOT_NEGATIVE, 2, 0}, {"-5", 1, 2, SignStyle.NOT_NEGATIVE, 2, -5}, {"-50", 1, 2, SignStyle.NOT_NEGATIVE, 3, -50}, {"-500", 1, 2, SignStyle.NOT_NEGATIVE, 4, -500}, {"-AAA", 1, 2, SignStyle.NOT_NEGATIVE, 1, null}, {"+0", 1, 2, SignStyle.NOT_NEGATIVE, 2, 0}, {"+5", 1, 2, SignStyle.NOT_NEGATIVE, 2, 5}, {"+50", 1, 2, SignStyle.NOT_NEGATIVE, 3, 50}, {"+500", 1, 2, SignStyle.NOT_NEGATIVE, 4, 500}, {"+AAA", 1, 2, SignStyle.NOT_NEGATIVE, 1, null}, {"50", 2, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"-50", 2, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+50", 2, 2, SignStyle.NOT_NEGATIVE, 0, null}, // normal {"0", 1, 2, SignStyle.NORMAL, 1, 0}, {"5", 1, 2, SignStyle.NORMAL, 1, 5}, {"50", 1, 2, SignStyle.NORMAL, 2, 50}, {"500", 1, 2, SignStyle.NORMAL, 3, 500}, {"-0", 1, 2, SignStyle.NORMAL, 2, 0}, {"-5", 1, 2, SignStyle.NORMAL, 2, -5}, {"-50", 1, 2, SignStyle.NORMAL, 3, -50}, {"-500", 1, 2, SignStyle.NORMAL, 4, -500}, {"-AAA", 1, 2, SignStyle.NORMAL, 1, null}, {"+0", 1, 2, SignStyle.NORMAL, 2, 0}, {"+5", 1, 2, SignStyle.NORMAL, 2, 5}, {"+50", 1, 2, SignStyle.NORMAL, 3, 50}, {"+500", 1, 2, SignStyle.NORMAL, 4, 500}, {"+AAA", 1, 2, SignStyle.NORMAL, 1, null}, {"50", 2, 2, SignStyle.NORMAL, 2, 50}, {"-50", 2, 2, SignStyle.NORMAL, 3, -50}, {"+50", 2, 2, SignStyle.NORMAL, 3, 50}, // always {"0", 1, 2, SignStyle.ALWAYS, 1, 0}, {"5", 1, 2, SignStyle.ALWAYS, 1, 5}, {"50", 1, 2, SignStyle.ALWAYS, 2, 50}, {"500", 1, 2, SignStyle.ALWAYS, 3, 500}, {"-0", 1, 2, SignStyle.ALWAYS, 2, 0}, {"-5", 1, 2, SignStyle.ALWAYS, 2, -5}, {"-50", 1, 2, SignStyle.ALWAYS, 3, -50}, {"-500", 1, 2, SignStyle.ALWAYS, 4, -500}, {"-AAA", 1, 2, SignStyle.ALWAYS, 1, null}, {"+0", 1, 2, SignStyle.ALWAYS, 2, 0}, {"+5", 1, 2, SignStyle.ALWAYS, 2, 5}, {"+50", 1, 2, SignStyle.ALWAYS, 3, 50}, {"+500", 1, 2, SignStyle.ALWAYS, 4, 500}, {"+AAA", 1, 2, SignStyle.ALWAYS, 1, null}, // exceeds pad {"0", 1, 2, SignStyle.EXCEEDS_PAD, 1, 0}, {"5", 1, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"50", 1, 2, SignStyle.EXCEEDS_PAD, 2, 50}, {"500", 1, 2, SignStyle.EXCEEDS_PAD, 3, 500}, {"-0", 1, 2, SignStyle.EXCEEDS_PAD, 2, 0}, {"-5", 1, 2, SignStyle.EXCEEDS_PAD, 2, -5}, {"-50", 1, 2, SignStyle.EXCEEDS_PAD, 3, -50}, {"-500", 1, 2, SignStyle.EXCEEDS_PAD, 4, -500}, {"-AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, {"+0", 1, 2, SignStyle.EXCEEDS_PAD, 2, 0}, {"+5", 1, 2, SignStyle.EXCEEDS_PAD, 2, 5}, {"+50", 1, 2, SignStyle.EXCEEDS_PAD, 3, 50}, {"+500", 1, 2, SignStyle.EXCEEDS_PAD, 4, 500}, {"+AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, }; }
Example 19
Source File: TestNumberParser.java From j2objc with Apache License 2.0 | 4 votes |
@DataProvider public static Object[][] provider_parseSignsLenient() { return new Object[][] { // never {"0", 1, 2, SignStyle.NEVER, 1, 0}, {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"50", 1, 2, SignStyle.NEVER, 2, 50}, {"500", 1, 2, SignStyle.NEVER, 3, 500}, {"-0", 1, 2, SignStyle.NEVER, 2, 0}, {"-5", 1, 2, SignStyle.NEVER, 2, -5}, {"-50", 1, 2, SignStyle.NEVER, 3, -50}, {"-500", 1, 2, SignStyle.NEVER, 4, -500}, {"-AAA", 1, 2, SignStyle.NEVER, 1, null}, {"+0", 1, 2, SignStyle.NEVER, 2, 0}, {"+5", 1, 2, SignStyle.NEVER, 2, 5}, {"+50", 1, 2, SignStyle.NEVER, 3, 50}, {"+500", 1, 2, SignStyle.NEVER, 4, 500}, {"+AAA", 1, 2, SignStyle.NEVER, 1, null}, {"50", 2, 2, SignStyle.NEVER, 2, 50}, {"-50", 2, 2, SignStyle.NEVER, 0, null}, {"+50", 2, 2, SignStyle.NEVER, 0, null}, // not negative {"0", 1, 2, SignStyle.NOT_NEGATIVE, 1, 0}, {"5", 1, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"50", 1, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"500", 1, 2, SignStyle.NOT_NEGATIVE, 3, 500}, {"-0", 1, 2, SignStyle.NOT_NEGATIVE, 2, 0}, {"-5", 1, 2, SignStyle.NOT_NEGATIVE, 2, -5}, {"-50", 1, 2, SignStyle.NOT_NEGATIVE, 3, -50}, {"-500", 1, 2, SignStyle.NOT_NEGATIVE, 4, -500}, {"-AAA", 1, 2, SignStyle.NOT_NEGATIVE, 1, null}, {"+0", 1, 2, SignStyle.NOT_NEGATIVE, 2, 0}, {"+5", 1, 2, SignStyle.NOT_NEGATIVE, 2, 5}, {"+50", 1, 2, SignStyle.NOT_NEGATIVE, 3, 50}, {"+500", 1, 2, SignStyle.NOT_NEGATIVE, 4, 500}, {"+AAA", 1, 2, SignStyle.NOT_NEGATIVE, 1, null}, {"50", 2, 2, SignStyle.NOT_NEGATIVE, 2, 50}, {"-50", 2, 2, SignStyle.NOT_NEGATIVE, 0, null}, {"+50", 2, 2, SignStyle.NOT_NEGATIVE, 0, null}, // normal {"0", 1, 2, SignStyle.NORMAL, 1, 0}, {"5", 1, 2, SignStyle.NORMAL, 1, 5}, {"50", 1, 2, SignStyle.NORMAL, 2, 50}, {"500", 1, 2, SignStyle.NORMAL, 3, 500}, {"-0", 1, 2, SignStyle.NORMAL, 2, 0}, {"-5", 1, 2, SignStyle.NORMAL, 2, -5}, {"-50", 1, 2, SignStyle.NORMAL, 3, -50}, {"-500", 1, 2, SignStyle.NORMAL, 4, -500}, {"-AAA", 1, 2, SignStyle.NORMAL, 1, null}, {"+0", 1, 2, SignStyle.NORMAL, 2, 0}, {"+5", 1, 2, SignStyle.NORMAL, 2, 5}, {"+50", 1, 2, SignStyle.NORMAL, 3, 50}, {"+500", 1, 2, SignStyle.NORMAL, 4, 500}, {"+AAA", 1, 2, SignStyle.NORMAL, 1, null}, {"50", 2, 2, SignStyle.NORMAL, 2, 50}, {"-50", 2, 2, SignStyle.NORMAL, 3, -50}, {"+50", 2, 2, SignStyle.NORMAL, 3, 50}, // always {"0", 1, 2, SignStyle.ALWAYS, 1, 0}, {"5", 1, 2, SignStyle.ALWAYS, 1, 5}, {"50", 1, 2, SignStyle.ALWAYS, 2, 50}, {"500", 1, 2, SignStyle.ALWAYS, 3, 500}, {"-0", 1, 2, SignStyle.ALWAYS, 2, 0}, {"-5", 1, 2, SignStyle.ALWAYS, 2, -5}, {"-50", 1, 2, SignStyle.ALWAYS, 3, -50}, {"-500", 1, 2, SignStyle.ALWAYS, 4, -500}, {"-AAA", 1, 2, SignStyle.ALWAYS, 1, null}, {"+0", 1, 2, SignStyle.ALWAYS, 2, 0}, {"+5", 1, 2, SignStyle.ALWAYS, 2, 5}, {"+50", 1, 2, SignStyle.ALWAYS, 3, 50}, {"+500", 1, 2, SignStyle.ALWAYS, 4, 500}, {"+AAA", 1, 2, SignStyle.ALWAYS, 1, null}, // exceeds pad {"0", 1, 2, SignStyle.EXCEEDS_PAD, 1, 0}, {"5", 1, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"50", 1, 2, SignStyle.EXCEEDS_PAD, 2, 50}, {"500", 1, 2, SignStyle.EXCEEDS_PAD, 3, 500}, {"-0", 1, 2, SignStyle.EXCEEDS_PAD, 2, 0}, {"-5", 1, 2, SignStyle.EXCEEDS_PAD, 2, -5}, {"-50", 1, 2, SignStyle.EXCEEDS_PAD, 3, -50}, {"-500", 1, 2, SignStyle.EXCEEDS_PAD, 4, -500}, {"-AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, {"+0", 1, 2, SignStyle.EXCEEDS_PAD, 2, 0}, {"+5", 1, 2, SignStyle.EXCEEDS_PAD, 2, 5}, {"+50", 1, 2, SignStyle.EXCEEDS_PAD, 3, 50}, {"+500", 1, 2, SignStyle.EXCEEDS_PAD, 4, 500}, {"+AAA", 1, 2, SignStyle.EXCEEDS_PAD, 1, null}, }; }
Example 20
Source File: TestNumberParser.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@DataProvider(name="parseDigitsLenient") Object[][] provider_parseDigitsLenient() { return new Object[][] { // never {"5", 1, 2, SignStyle.NEVER, 1, 5}, {"5", 2, 2, SignStyle.NEVER, 1, 5}, {"54", 1, 3, SignStyle.NEVER, 2, 54}, {"54", 2, 3, SignStyle.NEVER, 2, 54}, {"54", 3, 3, SignStyle.NEVER, 2, 54}, {"543", 1, 3, SignStyle.NEVER, 3, 543}, {"543", 2, 3, SignStyle.NEVER, 3, 543}, {"543", 3, 3, SignStyle.NEVER, 3, 543}, {"5432", 1, 3, SignStyle.NEVER, 4, 5432}, {"5432", 2, 3, SignStyle.NEVER, 4, 5432}, {"5432", 3, 3, SignStyle.NEVER, 4, 5432}, {"5AAA", 2, 3, SignStyle.NEVER, 1, 5}, // not negative {"5", 1, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"5", 2, 2, SignStyle.NOT_NEGATIVE, 1, 5}, {"54", 1, 3, SignStyle.NOT_NEGATIVE, 2, 54}, {"54", 2, 3, SignStyle.NOT_NEGATIVE, 2, 54}, {"54", 3, 3, SignStyle.NOT_NEGATIVE, 2, 54}, {"543", 1, 3, SignStyle.NOT_NEGATIVE, 3, 543}, {"543", 2, 3, SignStyle.NOT_NEGATIVE, 3, 543}, {"543", 3, 3, SignStyle.NOT_NEGATIVE, 3, 543}, {"5432", 1, 3, SignStyle.NOT_NEGATIVE, 4, 5432}, {"5432", 2, 3, SignStyle.NOT_NEGATIVE, 4, 5432}, {"5432", 3, 3, SignStyle.NOT_NEGATIVE, 4, 5432}, {"5AAA", 2, 3, SignStyle.NOT_NEGATIVE, 1, 5}, // normal {"5", 1, 2, SignStyle.NORMAL, 1, 5}, {"5", 2, 2, SignStyle.NORMAL, 1, 5}, {"54", 1, 3, SignStyle.NORMAL, 2, 54}, {"54", 2, 3, SignStyle.NORMAL, 2, 54}, {"54", 3, 3, SignStyle.NORMAL, 2, 54}, {"543", 1, 3, SignStyle.NORMAL, 3, 543}, {"543", 2, 3, SignStyle.NORMAL, 3, 543}, {"543", 3, 3, SignStyle.NORMAL, 3, 543}, {"5432", 1, 3, SignStyle.NORMAL, 4, 5432}, {"5432", 2, 3, SignStyle.NORMAL, 4, 5432}, {"5432", 3, 3, SignStyle.NORMAL, 4, 5432}, {"5AAA", 2, 3, SignStyle.NORMAL, 1, 5}, // always {"5", 1, 2, SignStyle.ALWAYS, 1, 5}, {"5", 2, 2, SignStyle.ALWAYS, 1, 5}, {"54", 1, 3, SignStyle.ALWAYS, 2, 54}, {"54", 2, 3, SignStyle.ALWAYS, 2, 54}, {"54", 3, 3, SignStyle.ALWAYS, 2, 54}, {"543", 1, 3, SignStyle.ALWAYS, 3, 543}, {"543", 2, 3, SignStyle.ALWAYS, 3, 543}, {"543", 3, 3, SignStyle.ALWAYS, 3, 543}, {"5432", 1, 3, SignStyle.ALWAYS, 4, 5432}, {"5432", 2, 3, SignStyle.ALWAYS, 4, 5432}, {"5432", 3, 3, SignStyle.ALWAYS, 4, 5432}, {"5AAA", 2, 3, SignStyle.ALWAYS, 1, 5}, // exceeds pad {"5", 1, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"5", 2, 2, SignStyle.EXCEEDS_PAD, 1, 5}, {"54", 1, 3, SignStyle.EXCEEDS_PAD, 2, 54}, {"54", 2, 3, SignStyle.EXCEEDS_PAD, 2, 54}, {"54", 3, 3, SignStyle.EXCEEDS_PAD, 2, 54}, {"543", 1, 3, SignStyle.EXCEEDS_PAD, 3, 543}, {"543", 2, 3, SignStyle.EXCEEDS_PAD, 3, 543}, {"543", 3, 3, SignStyle.EXCEEDS_PAD, 3, 543}, {"5432", 1, 3, SignStyle.EXCEEDS_PAD, 4, 5432}, {"5432", 2, 3, SignStyle.EXCEEDS_PAD, 4, 5432}, {"5432", 3, 3, SignStyle.EXCEEDS_PAD, 4, 5432}, {"5AAA", 2, 3, SignStyle.EXCEEDS_PAD, 1, 5}, }; }