Grammalecte  Check-in [e5a9fff52e]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

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 2020-07-27 11:33:46
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: fr, trunk
11:32
[fr] faux positifs et ajustements check-in: b2f3dff479 user: olr tags: fr, trunk
Changes

Changes to gc_lang/fr/modules/tests.py.

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: