mbien commented on code in PR #7910:
URL: https://github.com/apache/netbeans/pull/7910#discussion_r1817880412


##########
java/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/TreeRuleTestBase.java:
##########
@@ -242,9 +242,11 @@ protected String performFixTest(String fileName, String 
code, int pos, String er
         String realCode = toCheckDocument.getText(0, 
toCheckDocument.getLength());
         
         //ignore whitespaces:
-        realCode = realCode.replaceAll("[ \t\n]+", " ");
+        realCode = realCode.replaceAll("[ \t\r\n]+", " ");
 
         if (golden != null) {
+           //ignore CRLF/LF differences in golden:
+            golden = golden.replaceAll("[ \t\r\n]+", " ");

Review Comment:
   this seems to go beyond line separators, `\\s+` might be the more direct 
approach to normalize whitespace?



##########
java/java.source.base/test/unit/src/org/netbeans/modules/java/source/indexing/VanillaCompileWorkerTest.java:
##########
@@ -685,6 +685,7 @@ public void testPreserveValidMethods1() throws Exception {
                 "        System.err.println(\"Hello, world!\");\n" +
                 "    }\n" +
                 "}");
+        file2Fixed.replaceAll((k, v) -> v.replaceAll("\r\n", "\n"));
         assertEquals(expected, file2Fixed);

Review Comment:
   I am surprised that this is needed since golden files should be already 
covered by https://github.com/apache/netbeans/blob/master/.gitattributes (since 
they typically are `.java` files)
   
   you did also mention
   > the latter may also be addressed via git config --local core.autocrlf 
false;
   
   right, but local git config adjustments should not be needed in our case 
since the nb repo should know the requirements already.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to