[4suite-checkins] In Amara/test/scimitar, files basics.py
Uche Ogbuji
uogbuji at 4suite.org
Mon Aug 14 01:28:08 MDT 2006
Update of /var/local/cvsroot/Amara/test/scimitar
In directory dollar:/tmp/cvs-serv7882/test/scimitar
Modified Files:
basics.py
Log Message:
Fix regex:match etc. in rules ( https://sourceforge.net/tracker/?func=detail&atid=428292&aid=1539109&group_id=39954 )
ViewCVS diff:
http://cvs.4suite.org/viewcvs/Amara/test/scimitar/basics.py.diff?r1=1.6&r2=1.7
ViewCVS view:
http://cvs.4suite.org/viewcvs/Amara/test/scimitar/basics.py?rev=1.7&content-type=text/vnd.viewcvs-markup
Index: basics.py
===================================================================
RCS file: /var/local/cvsroot/Amara/test/scimitar/basics.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -U2 -r1.6 -r1.7
--- basics.py 29 Jul 2006 14:47:02 -0000 1.6
+++ basics.py 14 Aug 2006 07:28:08 -0000 1.7
@@ -136,5 +136,18 @@
'''
-STRON8 = '''\
+STRON_EVDV_060912 = '''\
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="exslt">
+ <ns prefix="regexp" uri="http://exslt.org/regular-expressions"/>
+ <pattern>
+ <rule context="*">
+ <let name="matches" value="regexp:match(normalize-space(.), '\.')"/>
+ <report test="$matches">Found a dot in <name/></report>
+ </rule>
+ </pattern>
+</schema>
+'''
+
+STRONX = '''\
<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"
@@ -177,4 +190,7 @@
<dog><ear/><bone/></dog>'''.encode(ENCODING)
+INSTANCE5 = u'''\
+<a><b>.</b><c></c><d> . </d></a>'''.encode(ENCODING)
+
def normalize_text(text):
@@ -330,4 +346,10 @@
self.assertEqual(output, expected)
+ def testStron19(self):
+ output = run_stron(STRON_EVDV_060912, INSTANCE5)
+ output = normalize_text(output)
+ expected = '<?xml version="1.0" encoding="UTF-8"?>\nProcessing schema: Processing pattern: [unnamed]\nReport:\nFound a dot in a\nReport:\nFound a dot in b\nReport:\nFound a dot in d\n'
+ self.assertEqual(output, expected)
+
class TestOddCases(unittest.TestCase):
More information about the 4suite-checkins
mailing list