Build a test suite
For the implementation and testing of the python parser, as well as the support for different USFM features by the underlying grammar, we need to build a large test suite covering at least all test cases we had in V2.
This should ideally include, input USFMs, expected outputs in different formats like JSONs, CSVs, USX etc
Using USFM/X committee's test suite.
Current status https://github.com/Bridgeconn/usfm-grammar/pull/182#issuecomment-1283951776
Current Status
- Total USFM samples in the test suite = 249
- No. of positive tests = 197/249
- Correctly parsing(Generating syntax tree and/or errors) = 184/249
- The reason for failure of 65 samples are recorded here
- No of positive tests among these are 154
- Able to generate JSON without raising error for 154/154 (Correctness of JSON is not yet verified)
- Able to generate USX without raising error for 154/154
- Generated USX confirms to the USX.rnc grammar(With a few modifications) for 86/154
- The reason for failure of 68 cases are recorded here
- Comparing with the USX sample in test suite
- No. of USX files in test suite passing validatio by the USX.rnc grammar = 81/154
- No. of cases where our generated USX == Origin.xml of the testsuite = 21/154
Another update https://github.com/usfm-bible/tcdocs/pull/44
Upon pulling latest tests from tcdocs, finding these grammar rule changes in test suite even though https://docs.usfm.bible/usfm-usx-docs/latest/index.html doesn't reflect most of them yet:
- \fig is allowed in \f, as per this testcase, which is stated as a newly supported feature in 3.0 and 3.1.
- gloss is a required attribute in \rb as per this testcase. But this testcase contradicts it.
whois the default attribute of \qt-s, as per this testcase.- Some unidentified issue with \imt# or \imte#, in this testcase.
- \cat is now allowed witthin \f, immediately after caller, as per this testcase.
- Empty \w \w*, is supposed to fail now, as per this testcase.
- Empty book with only \id line are supposed to fail now, as per this testcase. Does it make any specific type of makers mandatory like \p or does it simply require something else along with \id? Will one of header markers, intro markers, comments(\rem) or \c do?
- Newly added
\refmarker, as seen in this testcase.- :warning: But its USX is different from other markers. with type=ref instead of char and no style attribute
<ref loc="MRK 1:4">Mark 1:4</ref>
- :warning: But its USX is different from other markers. with type=ref instead of char and no style attribute
- Allow both
\xtand\+xtwithin footnotes. As per this tescase and this testcase. - Allow attributes without link- prefix (href, id etc.)