julianhyde commented on code in PR #3663:
URL: https://github.com/apache/calcite/pull/3663#discussion_r1771836704
##########
core/src/test/java/org/apache/calcite/util/UtilTest.java:
##########
@@ -209,6 +215,73 @@ class UtilTest {
Util.toScientificNotation(bd));
}
+ @Test void testDoubleScientificNotation() {
+ double d = parseDouble("0.001234");
+ TestUtil.assertEqualsVerbose(
+ "0.001234E0",
+ Util.toScientificNotation(d));
+ d = parseDouble("0.001");
Review Comment:
I find that redundancy makes it difficult to see patterns in tests. Consider
introducing a helper method, so that
```
d = parseDouble("0.001234");
TestUtil.assertEqualsVerbose(
"0.001234E0",
Util.toScientificNotation(d));
```
becomes
```
assertThatScientific("0.001234", is("0.001234E0"));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]