static public String test()

in src/ParityTests.java [23:84]


	 static public String test(String pattern, double value) throws IOException {
		List<Double> numberList = new ArrayList<Double>(6);
		List<String> stringList = new ArrayList<String>();
		Boolean success = false;
		Boolean isDecimalSeparatorAlwaysShown = false;
		String errorMessage = "";

		numberList.add(value);
		stringList.add(pattern);

		try {
			DecimalFormat df = new DecimalFormat(pattern);
			String output = df.format(value);

			numberList.add((double) df.getGroupingSize());
			numberList.add((double) df.getMaximumFractionDigits());
			numberList.add((double) df.getMaximumIntegerDigits());
			numberList.add((double) df.getMinimumFractionDigits());
			numberList.add((double) df.getMinimumIntegerDigits());
			numberList.add((double) df.getMultiplier());

			stringList.add(df.getPositivePrefix());
			stringList.add(df.getPositiveSuffix());
			stringList.add(df.getNegativePrefix());
			stringList.add(df.getNegativeSuffix());
			stringList.add(output);

			isDecimalSeparatorAlwaysShown = df.isDecimalSeparatorAlwaysShown();
			success = true;
		} catch (IllegalArgumentException e) {
			errorMessage = e.toString();
		}

		if (success) {
			String[] props = new String[14];

			props[0] = lazyJSONPair("pattern", stringList.get(0));
			props[1] = lazyJSONPair("success", success);
			props[2] = lazyJSONPair("positivePrefix", stringList.get(1));
			props[3] = lazyJSONPair("positiveSuffix", stringList.get(2));
			props[4] = lazyJSONPair("negativePrefix", stringList.get(3));
			props[5] = lazyJSONPair("negativeSuffix", stringList.get(4));
			props[6] = lazyJSONPair("output", stringList.get(5));
			props[7] = lazyJSONPair("input", numberList.get(0));
			props[8] = lazyJSONPair("groupingSize", numberList.get(1));
			props[9] = lazyJSONPair("maximumFractionDigits", numberList.get(2));
			props[10] = lazyJSONPair("maximumIntegerDigits", numberList.get(3));
			props[11] = lazyJSONPair("minimumFractionDigits", numberList.get(4));
			props[12] = lazyJSONPair("minimumIntegerDigits", numberList.get(5));
			props[13] = lazyJSONPair("multiplier", numberList.get(5));

			return "{" + String.join(", ", props) + "}";
		} else {
			String[] props = new String[3];

			props[0] = lazyJSONPair("pattern", stringList.get(0));
			props[1] = lazyJSONPair("success", success);
			props[2] = lazyJSONPair("error", errorMessage);

			return "{" + String.join(", ", props) + "}";
		}
	}