You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by ma...@apache.org on 2017/11/25 13:54:26 UTC

[incubator-netbeans] 01/03: fix AssertionFailedError in org.netbeans.modules.templates.SCFTHandlerTest - windows (replace crlf characters with lf)

This is an automated email from the ASF dual-hosted git repository.

matthiasblaesing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git

commit 4ba430016273040c52c6cf9dab72ae4095e160c0
Author: Sarvesh Kesharwani <sa...@oracle.com>
AuthorDate: Wed Nov 8 11:02:53 2017 +0530

    fix AssertionFailedError in org.netbeans.modules.templates.SCFTHandlerTest - windows (replace crlf characters with lf)
---
 .../unit/src/org/netbeans/modules/templates/SCFTHandlerTest.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/api.templates/test/unit/src/org/netbeans/modules/templates/SCFTHandlerTest.java b/api.templates/test/unit/src/org/netbeans/modules/templates/SCFTHandlerTest.java
index 745a312..da750ca 100644
--- a/api.templates/test/unit/src/org/netbeans/modules/templates/SCFTHandlerTest.java
+++ b/api.templates/test/unit/src/org/netbeans/modules/templates/SCFTHandlerTest.java
@@ -226,7 +226,8 @@ public class SCFTHandlerTest extends NbTestCase {
         byte[] arr = new byte[(int)fo.getSize()];
         int len = fo.getInputStream().read(arr);
         assertEquals("Fully read", arr.length, len);
-        return new String(arr);
+        String foRead = new String(arr).replace(System.getProperty("line.separator"), "\n");
+        return foRead;
     }
 
     private static String readChars(FileObject fo, Charset set) throws IOException {
@@ -329,9 +330,10 @@ public class SCFTHandlerTest extends NbTestCase {
             fail("no input stream for " + snd);
         }
         String read = new String(cbuf, 0, len);
-        txt = txt.replaceAll("print\\('", "").replaceAll("'\\)", "") +'\n';
+        String normRead = read.replace(System.getProperty("line.separator"), "\n");
+        txt = txt.replaceAll("print\\('", "").replaceAll("'\\)", "") + "\n";
         
-        assertEquals(txt, read);
+        assertEquals(txt, normRead);
     }
      
     public static final class DD extends DialogDisplayer {

-- 
To stop receiving notification emails like this one, please contact
"commits@netbeans.apache.org" <co...@netbeans.apache.org>.