pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Dai (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (PIG-3070) PigTest - Patch for PIG-3027 - Pls review to see if trim required after replacing all "\r\n" with "\n" to avoid additional newline at end of expected string.
Date Thu, 26 Sep 2013 23:51:02 GMT

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

Daniel Dai resolved PIG-3070.
-----------------------------

    Resolution: Won't Fix

TestPigTest works for me. Close the ticket.
                
> PigTest - Patch for PIG-3027 - Pls review to see if trim required after replacing all
"\r\n" with "\n" to avoid additional newline at end of expected string. 
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-3070
>                 URL: https://issues.apache.org/jira/browse/PIG-3070
>             Project: Pig
>          Issue Type: Bug
>          Components: build
>    Affects Versions: 0.10.0
>            Reporter: Raghavendra Saravanamurthy
>            Assignee: Daniel Dai
>            Priority: Minor
>             Fix For: 0.12.0
>
>
> Ref Patch: https://issues.apache.org/jira/secure/attachment/12552008/PIG-3027.trunk.1.patch
> With the above patch fix:
> readFile(expected).replaceAll("\r\n", "\n") gives the expected file contents as (note:
the exp file does not contain a "\n" after the last line of text):
> ~~~~~~~~~~~~~~~~~~~~
> (yahoo,25)
> (facebook,15)
> (twitter,7)
> 12/11/28 02:59:06 INFO pigunit.PigTest:..............
> ~~~~~~~~~~~~~~~~~~~~
> And the test case fails with:
> ~~~~~~~~~~~~~~~~~~~~
> junit.framework.ComparisonFailure: expected:<...book,15)
> (twitter,7)[
> ]> but was:<...book,15)
> (twitter,7)[]>
>         at junit.framework.Assert.assertEquals(Assert.java:85)
>         at junit.framework.Assert.assertEquals(Assert.java:91)
> ~~~~~~~~~~~~~~~~~~~~
> After adding trim to the above patch:
> readFile(expected).replaceAll("\r\n", "\n").trim() gives the expected file contents as:
> ~~~~~~~~~~~~~~~~~~~~
> (yahoo,25)
> (facebook,15)
> (twitter,7)
> 12/11/28 03:10:06 INFO pigunit.PigTest:..............
> ~~~~~~~~~~~~~~~~~~~~
> And the above test case passed.
> Please review if trim should be added to avoid the additional newline at the end of expected
string.
> Pls note: I was running the tests in rhel environment.
> Thank you.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message