Index: gc_core/py/lang_core/tests_core.py ================================================================== --- gc_core/py/lang_core/tests_core.py +++ gc_core/py/lang_core/tests_core.py @@ -103,11 +103,11 @@ "\n expected: " + sExpectedErrors + \ "\n found: " + sFoundErrors + \ "\n errors: \n" + sListErr) nUnexpectedErrors += 1 elif sExceptedSuggs: - if sExceptedSuggs != sFoundSuggs: + if not self._checkSuggestions(sExceptedSuggs, sFoundSuggs): print("\n# Line num: " + sLineNum + \ "\n> to check: " + _fuckBackslashUTF8(sTextToCheck) + \ "\n expected: " + sExceptedSuggs + \ "\n found: " + sFoundSuggs + \ "\n errors: \n" + sListErr) @@ -166,10 +166,20 @@ for i, m in enumerate(self._zError.finditer(sLine)): nStart = m.start() - (4 * i) nEnd = m.end() - (4 * (i+1)) sRes = sRes[:nStart] + "~" * (nEnd - nStart) + sRes[nEnd:-4] return sRes + + def _checkSuggestions (self, sExceptedSuggs, sFoundSuggs): + lAllExpectedSuggs = sExceptedSuggs.split("|||") + lAllFoundSuggs = sFoundSuggs.split("|||") + if len(lAllExpectedSuggs) != len(lAllFoundSuggs): + return False + for sExceptedSuggs, sFoundSuggs in zip(lAllExpectedSuggs, lAllFoundSuggs): + if set(sExceptedSuggs.split("|")) != set(sFoundSuggs.split("|")): + return False + return True def purgeMessage (sMessage): for sToReplace, sReplacement in [ ("l’ ", "l’"), ("d’ ", "d’"), ("n’ ", "n’"), ("j’ ", "j’"), ("m’ ", "m’"), ("t’ ", "t’"), ("s’ ", "s’"), ("qu’ ", "qu’"),