[GitHub] [maven] josephw commented on a change in pull request #264: [MNG-6535] Improve test coverage of UrlNormalizer.

2019-07-08 Thread GitBox
josephw commented on a change in pull request #264: [MNG-6535] Improve test 
coverage of UrlNormalizer.
URL: https://github.com/apache/maven/pull/264#discussion_r301083798
 
 

 ##
 File path: 
maven-model-builder/src/test/java/org/apache/maven/model/path/DefaultUrlNormalizerTest.java
 ##
 @@ -82,8 +70,15 @@ public void testPreservationOfDoubleSlashes()
   normalize( 
"[fetch=]http://server.org/[push=]ssh://server.org/; ) );
 }
 
-public void testNormalizeInputWithNoParentDirectoriesToAscendTo()
+@Test
+public void 
relativeUriReferenceLeftUnaffectedWithNoParentDirectoryToAscendTo()
+{
+assertEquals( "/../", normalize("/../" ) );
 
 Review comment:
   `Path` and `URI` differ slightly here; I've gone with [RFC 3986's Remove Dot 
Segments](https://tools.ietf.org/html/rfc3986#section-5.2.4) and adjusted the 
code to remove them.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [maven] josephw commented on a change in pull request #264: [MNG-6535] Improve test coverage of UrlNormalizer.

2019-07-06 Thread GitBox
josephw commented on a change in pull request #264: [MNG-6535] Improve test 
coverage of UrlNormalizer.
URL: https://github.com/apache/maven/pull/264#discussion_r300849941
 
 

 ##
 File path: 
maven-model-builder/src/test/java/org/apache/maven/model/path/DefaultUrlNormalizerTest.java
 ##
 @@ -82,4 +82,8 @@ public void testPreservationOfDoubleSlashes()
   normalize( 
"[fetch=]http://server.org/[push=]ssh://server.org/; ) );
 }
 
+public void testNormalizeInputWithNoParentDirectoriesToAscendTo()
+{
+assertEquals("a/../", normalize("a/../"));
+}
 
 Review comment:
   Thinking again; there's no reason to retain the existing behaviour if it's 
wrong. The change to match `Path` is simple enough, and doesn't break the 
existing tests: I've pushed it.
   
   Ideally, the interface would be clearer about its contract, but this is the 
least surprising behaviour.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [maven] josephw commented on a change in pull request #264: [MNG-6535] Improve test coverage of UrlNormalizer.

2019-07-05 Thread GitBox
josephw commented on a change in pull request #264: [MNG-6535] Improve test 
coverage of UrlNormalizer.
URL: https://github.com/apache/maven/pull/264#discussion_r300662335
 
 

 ##
 File path: 
maven-model-builder/src/test/java/org/apache/maven/model/path/DefaultUrlNormalizerTest.java
 ##
 @@ -82,4 +82,8 @@ public void testPreservationOfDoubleSlashes()
   normalize( 
"[fetch=]http://server.org/[push=]ssh://server.org/; ) );
 }
 
+public void testNormalizeInputWithNoParentDirectoriesToAscendTo()
+{
+assertEquals("a/../", normalize("a/../"));
+}
 
 Review comment:
   I'm not sure it's worth changing the behaviour; this class is used with 
absolute URLs (or paths), so this is very much an edge case.
   
   However, I think it's (slightly) valuable to test that this case doesn't 
cause an error -- perhaps a different test name could make that clear?
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services