git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Comment Edited] (DAFFODIL-1928) TDMLRunner removes apostrophes from expected when ' is used in infoset


    [ https://issues.apache.org/jira/browse/DAFFODIL-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16490466#comment-16490466 ] 

Russ Williams edited comment on DAFFODIL-1928 at 5/25/18 9:28 AM:
------------------------------------------------------------------

Playing around with this a bit more, both 1.0.6 and 1.1.0 show the same behaviour:
 * ' is passed through OK
 * ' is passed through OK
 * ' is eaten
 * ' and ' compare as equal 

This means that the two tests fail because:
 # <tag>&amp;apos;</tag> = <tag></tag> = <tag /> which doesn't match <tag>'</tag>
 # The input document - a single &amp;apos; - is zero-length when that character is eaten, so the parser runs out of input

It's probably worth adding the other two cases for when the document/infoset both contain the same type of apostrophe, though only the ' vs ' case will currently pass.

If scala-xml 1.1.0 fixes the character event generation, something else must presumably be discarding the event?


was (Author: rmw42):
Playing around with this a bit more, both 1.0.6 and 1.1.0 show the same behaviour:
 * ' is passed through OK
 * &#39; is passed through OK
 * &apos; is eaten
 * ' and &#39; compare as equal 

This means that the two tests fail because:
 # <tag>&apos;</tag> = <tag></tag> = <tag /> which doesn't match <tag>'</tag>
 # The input document - a single &apos; - is zero-length when that character is eaten, so the parser runs out of input

It's probably worth adding the other two cases for when the document/infoset both contain the same type of apostrophe, though only the ' vs ' case will currently pass.

If scala-xml 1.1.0 fixes the character event generation, something else must presumably be discarding the event?

> TDMLRunner removes apostrophes from expected when &apos; is used in infoset
> ---------------------------------------------------------------------------
>
>                 Key: DAFFODIL-1928
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1928
>             Project: Daffodil
>          Issue Type: Bug
>          Components: TDML Runner
>    Affects Versions: 2.1.0
>            Reporter: Dave Thompson
>            Assignee: Russ Williams
>            Priority: Major
>             Fix For: 2.2.0
>
>
> TDMLRunner removes apostrophes from expected when &apos; is used in infoset. When the test is executed the apostrophes are stripped from the expected result which cause the comparison to fail.
> *Infoset in test:*
>    <infoset>
>      <dfdlInfoset>
>              <tns:record>
>               <tns:item>1</tns:item>
>               <tns:item>Column &apos;Number&apos; Two</tns:item>
>               <tns:item>3</tns:item>
>               <tns:item>4</tns:item>
>               <tns:item>5</tns:item>
>             </tns:record>
>      </dfdlInfoset>
>    </infoset>
> *Test Result:*
> [error] Test org.apache.daffodil.section07.escapeScheme.TestEscapeSchemeDebug.test_escBlkAposRemoved failed: java.lang.Exception:
> [error] Comparison failed.
> [error] Expected
> [error]          <record><item>1</item><item>Column Number Two</item><item>3</item><item>4</item><item>5</item></record>
> [error] Actual
> [error]           <record><item>1</item><item>Column 'Number' Two</item><item>3</item><item>4</item><item>5</item></record>
> [error] Differences were (path, expected, actual):
> [error] (record/item[2],'Column Number Two','Column 'Number' Two'), took 2.114 sec
> *See daffodil-tdml Debug Test Case:*
> org.apache.daffodil.tdml.TestTDMLRunner3.test_escBlkAposRemoved
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)