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


##########
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:
   > I am unsure about the original test writers intention here.
   
   the comment above does say `//ignore whitespaces:`. It is used to match 
refactored code with golden code. It essentially tries to substract formatting 
from code snippets to make them comparable as Strings in test cases. I can't 
imagine tabs or other special whitespace codepoints would carry special meaning 
here.
   
   As mentioned below golden files should all be checked out from git equally. 
the editor could choose to use localized line separators I suppose, but this 
would be the refactored code, not the golden files.
   
   So this _might_ not be a good sign that this has to clean up line separators 
of golden code too after the other line separator change was made.



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