import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.fail;
import java.util.LinkedHashMap;
import java.util.Map;
values.put("18-Jan-2019", 43483.);
for (String str : values.keySet()) {
- assertEquals(OperandResolver.coerceValueToDouble(new StringEval(str)), values.get(str), 0.00001);
+ try {
+ assertEquals(OperandResolver.coerceValueToDouble(new StringEval(str)), values.get(str), 0.00001);
+ } catch (EvaluationException e) {
+ fail("While handling: " + str + ". "
+ + "This failure can indicate that the wrong locale is used during test-execution, "
+ + "ensure you run with english/US via -Duser.language=en -Duser.country=US. "
+ + "Having: " + System.getProperty("user.language") + "/" + System.getProperty("user.country"), e);
+ }
}
}
assertTrue(Locale.ROOT.equals(ul) || Locale.getDefault().equals(ul));
final String textValue = NumberToTextConverter.toText(1234.56);
assertEquals(-1, textValue.indexOf('E'));
- Object cellValueO = Double.valueOf(1234.56);
+ Object cellValueO = 1234.56;
/*CellFormat cellFormat = new CellFormat("_-* #,##0.00_-;-* #,##0.00_-;_-* \"-\"??_-;_-@_-");
CellFormatResult result = cellFormat.apply(cellValueO);
CellFormat cfmt = CellFormat.getInstance("_-* #,##0.00_-;-* #,##0.00_-;_-* \"-\"??_-;_-@_-");
CellFormatResult result = cfmt.apply(cellValueO);
assertEquals(" 1,234.56 ", result.text,
- "This failure can indicate that the wrong locale is used during test-execution, ensure you run with english/US via -Duser.language=en -Duser.country=US");
+ "This failure can indicate that the wrong locale is used during test-execution, "
+ + "ensure you run with english/US via -Duser.language=en -Duser.country=US. "
+ + "Having: " + System.getProperty("user.language") + "/" + System.getProperty("user.country"));
}
/**
* A numeric format string like 0E+0 should be E+
*/
@Test
- void testWithEinFormat() throws Exception {
+ void testWithEinFormat() {
DataFormatter formatter = new DataFormatter();
// Format string literals with an E in them shouldn't be