You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Henning Schmiedehausen (JIRA)" <de...@velocity.apache.org> on 2007/03/08 01:10:40 UTC

[jira] Closed: (VELOCITY-185) [PATCH] ant test-encoding fails on Windows

     [ https://issues.apache.org/jira/browse/VELOCITY-185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Schmiedehausen closed VELOCITY-185.
-------------------------------------------


> [PATCH] ant test-encoding fails on Windows
> ------------------------------------------
>
>                 Key: VELOCITY-185
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-185
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.0-Release
>         Environment: Operating System: other
> Platform: PC
>            Reporter: Will Glass-Husain
>         Assigned To: Velocity-Dev List
>            Priority: Minor
>         Attachments: BaseTestCase.patch
>
>
> Ant test fails on Windows (specifically ant test-encoding) due to a problem 
> matching newlines between the result of parsing "encodingtest2.vm" and the 
> expected result "encodingtest2.cmp".
> Apparently, WinCVS translates Unix newline (LF) to the Windows newline (CR LF) 
> when checking out the files.  But the file "encodingtest2.cmp" already has 
> newlines in the windows format CR LF.  When it's checked out to a Win machine, 
> this turns into CR CR LF.  The result file (generated by the Velocity test), 
> generates CR LF for newline.
> According to the Java Spec, the unusual case of CR CR LF should be treated as 
> a single newline [1], along with CR LF and LF.    The Velocity test is smart 
> enough to normalize newlines (to make CR LF the same as LF).  But does not 
> treat CR CR LF as a newline.  Thus the compare file doesn't match the result 
> file and the test fails.
> Got all that?
> One solution would be to use CygWin CVS, which preserves the Unix newline 
> (LF), or check the box in WinCVS "Checkout files with the Unix LF".
> A better solution is to change the routine in Velocity test 
> (normalizeNewlines) that normalizes the newlines, to treat the following as 
> equivalent newlines LF (unix), CR LF (win), and CR CR LF (win mistranslated).  
> The one-line patch is attached,
> WILL
> [1] 
> http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#231571

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org