Index: gc_lang/fr/modules/tests.py ================================================================== --- gc_lang/fr/modules/tests.py +++ gc_lang/fr/modules/tests.py @@ -130,10 +130,11 @@ def test_parse (self): zOption = re.compile("^__([a-zA-Z0-9]+)__ ") spHere, spfThisFile = os.path.split(__file__) with open(os.path.join(spHere, "gc_test.txt"), "r", encoding="utf-8") as hSrc: + nError = 0 for sLine in ( s for s in hSrc if not s.startswith("#") and s.strip() ): sLineNum = sLine[:10].strip() sLine = sLine[10:].strip() sOption = None m = zOption.search(sLine) @@ -155,17 +156,21 @@ print("\n# Line num: " + sLineNum + \ "\n> to check: " + _fuckBackslashUTF8(sTextToCheck) + \ "\n expected: " + sExpectedErrors + \ "\n found: " + sFoundErrors + \ "\n errors: \n" + sListErr) + nError += 1 elif sExceptedSuggs: if sExceptedSuggs != sFoundSuggs: print("\n# Line num: " + sLineNum + \ "\n> to check: " + _fuckBackslashUTF8(sTextToCheck) + \ "\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 sLineId not in self._aRuleTested and not re.search("^[0-9]+[sp]$|^[pd]_", sRuleId): echo(sRuleId, end= ", ")