gnodet commented on code in PR #1080:
URL: https://github.com/apache/maven/pull/1080#discussion_r1158128883


##########
maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java:
##########
@@ -158,7 +158,7 @@ public void testCalculateDegreeOfConcurrency() {
         int cpus = Runtime.getRuntime().availableProcessors();
         assertEquals((int) (cpus * 2.2), 
cli.calculateDegreeOfConcurrency("2.2C"));
         assertEquals(1, cli.calculateDegreeOfConcurrency("0.0001C"));
-        assertThrows(IllegalArgumentException.class, () -> 
cli.calculateDegreeOfConcurrency("2.C"));
+        assertThrows(IllegalArgumentException.class, () -> 
cli.calculateDegreeOfConcurrency("2.xC"));

Review Comment:
   It's not really an extra test per se, I saw it as a test checking a bad 
float syntax. That's still the case.
   
   I can't keep really the old test, because that test would not throw an 
exception anymore, as `2.` is a legit float number according to the 
`Float.parseFloat` which is now used to validate the syntax. So while it is of 
course doable, it would actually add some specific code in the 
`calculateDegreeOfConcurrentcy` method simply to ensure this test fails.  I'm 
not really struck by the fact that `2.` is correctly parsed, and therefore that 
`2.C` is a valid degree of concurrency, so I'd rather keep the code lean and 
accept this use case as valid.



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to