]> dreyeck.freedombox.rocks Git - topic-maps.git/blobdiff - scripts/check-cxtm.py
Implement CTM Mergemap with explicit byte resources and isolated environments
[topic-maps.git] / scripts / check-cxtm.py
index d11f8ca31babb721069d9a7717c2e76fc08e3011..2dbd7d70b3355ded0b9bf1a29ce9d136eca0e420 100644 (file)
@@ -8,7 +8,7 @@ root = pathlib.Path(__file__).resolve().parent.parent
 report = json.loads(pathlib.Path(sys.argv[1]).read_text())
 assert report['kind'] == 'cxtm-byte-equality' and report['failed'] == 0
 assert report['passed'] == len(report['checks']) == len(set(report['checks']))
-expected_count = {'--slice-15': 85, '--slice-14': 64, '--slice-13': 61, '--slice-12a': 58, '--slice-5': 28, '--slice-6': 33, '--slice-7': 39, '--slice-8': 46, '--slice-9': 51, '--slice-10': 55, '--slice-11': 56}.get(sys.argv[2] if len(sys.argv) > 2 else '', 24)
+expected_count = {'--slice-19b': 171, '--slice-18': 167, '--slice-17b': 110, '--slice-17a': 97, '--slice-16b': 96, '--slice-15': 85, '--slice-14': 64, '--slice-13': 61, '--slice-12a': 58, '--slice-5': 28, '--slice-6': 33, '--slice-7': 39, '--slice-8': 46, '--slice-9': 51, '--slice-10': 55, '--slice-11': 56}.get(sys.argv[2] if len(sys.argv) > 2 else '', 24)
 assert len(report['cases']) == expected_count
 for case in report['cases']:
     actual = case['actualCXTM'].encode('utf-8')
@@ -51,6 +51,8 @@ for case in report['cases']:
             assert role_refs[r.attrib['ref']] == t.attrib['number']
     assert sum(len(t.findall('rolePlayed')) for t in topics) == len(role_refs)
     for ref in xml.iter():
+        if 'reifier' in ref.attrib:
+            assert 1 <= int(ref.attrib['reifier']) <= len(topics)
         if 'topicref' in ref.attrib:
             assert 1 <= int(ref.attrib['topicref']) <= len(topics)
 passes = sum(c['status'] == 'pass' for c in report['cases'])