Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #8 from zazi/sprint-42/dd-930
Browse files Browse the repository at this point in the history
[DD-930] added test empty string/ non-empty string
  • Loading branch information
fniederl committed Jul 7, 2015
2 parents bdbccf7 + 4c86bad commit 7c7fe70
Showing 1 changed file with 117 additions and 0 deletions.
117 changes: 117 additions & 0 deletions src/test/java/org/culturegraph/mf/morph/functions/Regexp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,121 @@
</result>
</test-case>

<test-case name="empty string (with equals function)">
<input type="text/x-cg+xml">
<cgxml:cgxml version="1.0">
<cgxml:records>
<cgxml:record id="1">
<cgxml:entity name="001">
<cgxml:literal name="" value="" />
</cgxml:entity>
</cgxml:record>
<cgxml:record id="2">
<cgxml:entity name="001">
<cgxml:literal name="" value="ABC" />
</cgxml:entity>
</cgxml:record>
</cgxml:records>
</cgxml:cgxml>
</input>
<transformation type="text/x-metamorph+xml">
<mm:metamorph version="1">
<mm:rules>
<mm:data source="001." name="subject">
<mm:equals string="" />
</mm:data>
</mm:rules>
</mm:metamorph>
</transformation>
<result type="text/x-cg+xml">
<cgxml:cgxml version="1.0">
<cgxml:records>
<cgxml:record id="1">
<cgxml:literal name="subject" value="" />
</cgxml:record>
<cgxml:record id="2">
</cgxml:record>
</cgxml:records>
</cgxml:cgxml>
</result>
</test-case>

<test-case name="non-empty string (with not-equals function)">
<input type="text/x-cg+xml">
<cgxml:cgxml version="1.0">
<cgxml:records>
<cgxml:record id="1">
<cgxml:entity name="001">
<cgxml:literal name="" value="" />
</cgxml:entity>
</cgxml:record>
<cgxml:record id="2">
<cgxml:entity name="001">
<cgxml:literal name="" value="ABC" />
</cgxml:entity>
</cgxml:record>
</cgxml:records>
</cgxml:cgxml>
</input>
<transformation type="text/x-metamorph+xml">
<mm:metamorph version="1">
<mm:rules>
<mm:data source="001." name="subject">
<mm:not-equals string="" />
</mm:data>
</mm:rules>
</mm:metamorph>
</transformation>
<result type="text/x-cg+xml">
<cgxml:cgxml version="1.0">
<cgxml:records>
<cgxml:record id="1">
</cgxml:record>
<cgxml:record id="2">
<cgxml:literal name="subject" value="ABC" />
</cgxml:record>
</cgxml:records>
</cgxml:cgxml>
</result>
</test-case>

<test-case name="non-empty string (with regexp)">
<input type="text/x-cg+xml">
<cgxml:cgxml version="1.0">
<cgxml:records>
<cgxml:record id="1">
<cgxml:entity name="001">
<cgxml:literal name="" value="" />
</cgxml:entity>
</cgxml:record>
<cgxml:record id="2">
<cgxml:entity name="001">
<cgxml:literal name="" value="ABC" />
</cgxml:entity>
</cgxml:record>
</cgxml:records>
</cgxml:cgxml>
</input>
<transformation type="text/x-metamorph+xml">
<mm:metamorph version="1">
<mm:rules>
<mm:data source="001." name="subject">
<mm:regexp match="^.+$" />
</mm:data>
</mm:rules>
</mm:metamorph>
</transformation>
<result type="text/x-cg+xml">
<cgxml:cgxml version="1.0">
<cgxml:records>
<cgxml:record id="1">
</cgxml:record>
<cgxml:record id="2">
<cgxml:literal name="subject" value="ABC" />
</cgxml:record>
</cgxml:records>
</cgxml:cgxml>
</result>
</test-case>

</metamorph-test>

0 comments on commit 7c7fe70

Please sign in to comment.