sid-srini commented on code in PR #7910:
URL: https://github.com/apache/netbeans/pull/7910#discussion_r1818119923


##########
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 didn't want to change the existing `realCode` replacement beyond handling 
`\r` in addition to `\n`. 
   - I am unsure about the original test writers intention here. 
   - My guess is that the code generation may add tabs and newlines as part of 
the re-formatting which is orthogonal to the test case. 
   - On the other hand `\\s+` might go beyond to other whitespace characters 
also, including unicode sequences.
   
   Further, my change to `golden` is only trying to establish a conformance to 
the pre-processing done on the `realCode`.



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