Grammalecte  Check-in [e5a9fff52e]

Overview
Comment:[fr] tests: untested rules displayed more clearly
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fr
Files: files | file ages | folders
SHA3-256: e5a9fff52ef11bff305afab54f47c6c010f96b10f3a1a1a2c3bfb64a72a32ab3
User & Date: olr on 2020-07-27 11:33:46
Other Links: manifest | tags
Context
2020-07-27
11:57
[fr] version 1.11.1 check-in: 2cdac2daf5 user: olr tags: trunk, v1.11.1
11:33
[fr] tests: untested rules displayed more clearly check-in: e5a9fff52e user: olr tags: trunk, fr
11:32
[fr] faux positifs et ajustements check-in: b2f3dff479 user: olr tags: trunk, fr
Changes

Modified gc_lang/fr/modules/tests.py from [9535e432e7] to [a7f5c21eb9].

200
201
202
203
204
205
206
207
208

209
210

211
212

213
214
215
216
217
218
219
220
                              "\n  expected: " + sExceptedSuggs + \
                              "\n  found:    " + sFoundSuggs + \
                              "\n  errors:   \n" + sListErr)
                        nError += 1
            if nError:
                print("Unexpected errors:", nError)
        # untested rules
        i = 0
        for _, sOpt, sLineId, sRuleId in gce.listRules():

            if sOpt != "@@@@" and sRuleId.rstrip("0123456789") not in self._aTestedRules and not re.search("^[0-9]+[sp]$|^[pd]_", sRuleId):
                echo(f"# untested rule: {sLineId}/{sRuleId}")

                i += 1
        if i:

            echo("  [{} untested rules]".format(i))

    def _splitTestLine (self, sLine):
        sText, sSugg = sLine.split("->>")
        return (sText.strip(), sSugg.strip())

    def _getFoundErrors (self, sLine, sOption):
        if sOption:







|

>
|
|
>
|
|
>
|







200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
                              "\n  expected: " + sExceptedSuggs + \
                              "\n  found:    " + sFoundSuggs + \
                              "\n  errors:   \n" + sListErr)
                        nError += 1
            if nError:
                print("Unexpected errors:", nError)
        # untested rules
        aUntestedRules = set()
        for _, sOpt, sLineId, sRuleId in gce.listRules():
            sRuleId = sRuleId.rstrip("0123456789")
            if sOpt != "@@@@" and sRuleId not in self._aTestedRules and not re.search("^[0-9]+[sp]$|^[pd]_", sRuleId):
                aUntestedRules.add(f"{sLineId}/{sRuleId}")
        if aUntestedRules:
            print()
            for sRule in aUntestedRules:
                echo(sRule)
            echo("  [{} untested rules]".format(len(aUntestedRules)))

    def _splitTestLine (self, sLine):
        sText, sSugg = sLine.split("->>")
        return (sText.strip(), sSugg.strip())

    def _getFoundErrors (self, sLine, sOption):
        if sOption: