Skip to content

Commit fdad535

Browse files
author
mgeipel
committed
added metamorph test cases
1 parent 7f5d191 commit fdad535

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

src/test/java/org/culturegraph/mf/morph/collectors/Misc.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
<input type="text/x-cg+xml">
8787
<cgxml:cgxml version="1.0">
8888
<cgxml:records>
89-
<cgxml:record id="1">
89+
<cgxml:record id="entity end info">
9090
<cgxml:entity name="e1">
9191
<cgxml:entity name="e2">
9292
<cgxml:literal name="d" value="a" />
@@ -111,7 +111,7 @@
111111
<result type="text/x-cg+xml">
112112
<cgxml:cgxml version="1.0">
113113
<cgxml:records>
114-
<cgxml:record id="1">
114+
<cgxml:record id="entity end info">
115115
<cgxml:literal name="e1.e2.d" value="a" />
116116
<cgxml:literal name="e1.e2" value="" />
117117
<cgxml:literal name="e1" value="" />

src/test/java/org/culturegraph/mf/morph/functions/Misc.xml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
xmlns="http://www.culturegraph.org/metamorph-test" xmlns:mm="http://www.culturegraph.org/metamorph"
44
xmlns:cgxml="http://www.culturegraph.org/cgxml">
55

6-
7-
86
<test-case name="regexp">
97
<input type="text/x-cg+xml">
108
<cgxml:cgxml version="1.0">
@@ -44,6 +42,38 @@
4442
</cgxml:cgxml>
4543
</result>
4644
</test-case>
45+
46+
<test-case name="substring">
47+
<input type="text/x-cg+xml">
48+
<cgxml:cgxml version="1.0">
49+
<cgxml:records>
50+
<cgxml:record id="1">
51+
<cgxml:literal name="a" value="012345" />
52+
</cgxml:record>
53+
</cgxml:records>
54+
</cgxml:cgxml>
55+
</input>
56+
57+
<transformation type="text/x-metamorph+xml">
58+
<mm:metamorph version="1">
59+
<mm:rules>
60+
<mm:data source="a">
61+
<mm:substring start="3" end="5"/>
62+
</mm:data>
63+
</mm:rules>
64+
</mm:metamorph>
65+
</transformation>
66+
67+
<result type="text/x-cg+xml">
68+
<cgxml:cgxml version="1.0">
69+
<cgxml:records>
70+
<cgxml:record id="1">
71+
<cgxml:literal name="a" value="34" />
72+
</cgxml:record>
73+
</cgxml:records>
74+
</cgxml:cgxml>
75+
</result>
76+
</test-case>
4777

4878
<test-case name="constant">
4979
<input type="text/x-cg+xml">

0 commit comments

Comments
 (0)