Grammalecte  Check-in [e39cca00d3]

Overview
Comment:[fr] fix tests.py
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fr
Files: files | file ages | folders
SHA3-256: e39cca00d34e3ad4a3c9c1d198313cf43cf5cafda6d95bc2577beb2fca658558
User & Date: olr on 2019-07-22 11:47:09
Other Links: manifest | tags
Context
2019-07-22
20:00
[core][fr] morphVC() update check-in: 02901ad6ae user: olr tags: core, fr, trunk
11:47
[fr] fix tests.py check-in: e39cca00d3 user: olr tags: fr, trunk
06:55
[core] listRules() check-in: 00c946ab84 user: olr tags: core, trunk
Changes

Modified gc_lang/fr/modules/tests.py from [4d8492a2e0] to [3d6c560ee1].

   202    202                                 "\n  found:    " + sFoundSuggs + \
   203    203                                 "\n  errors:   \n" + sListErr)
   204    204                           nError += 1
   205    205               if nError:
   206    206                   print("Unexpected errors:", nError)
   207    207           # untested rules
   208    208           i = 0
   209         -        for sOpt, sLineId, sRuleId in gce.listRules():
   210         -            if sOpt != "@@@@" and sLineId not in self._aTestedRules and not re.search("^[0-9]+[sp]$|^[pd]_", sRuleId):
          209  +        for _, sOpt, sLineId, sRuleId in gce.listRules():
          210  +            if sOpt != "@@@@" and sRuleId not in self._aTestedRules and not re.search("^[0-9]+[sp]$|^[pd]_", sRuleId):
   211    211                   echo(sLineId + "/" + sRuleId, end= ", ")
   212    212                   i += 1
   213    213           if i:
   214    214               echo("\n[{} untested rules]".format(i))
   215    215   
   216    216       def _splitTestLine (self, sLine):
   217    217           sText, sSugg = sLine.split("->>")
................................................................................
   227    227           sRes = " " * len(sLine)
   228    228           sListErr = ""
   229    229           lAllSugg = []
   230    230           for dErr in aErrs:
   231    231               sRes = sRes[:dErr["nStart"]] + "~" * (dErr["nEnd"] - dErr["nStart"]) + sRes[dErr["nEnd"]:]
   232    232               sListErr += "    * {sLineId} / {sRuleId}  at  {nStart}:{nEnd}\n".format(**dErr)
   233    233               lAllSugg.append("|".join(dErr["aSuggestions"]))
   234         -            self._aTestedRules.add(dErr["sLineId"])
          234  +            self._aTestedRules.add(dErr["sRuleId"])
   235    235               # test messages
   236    236               if "<start>" in dErr["sMessage"] or "<end>" in dErr["sMessage"]:
   237    237                   print("\n# Line num : " + dErr["sLineId"] + \
   238    238                         "\n  rule name: " + dErr["sRuleId"] + \
   239    239                         "\n  message  : " + dErr["sMessage"])
   240    240           return sRes, sListErr, "|||".join(lAllSugg)
   241    241