Index: gc_lang/fr/modules/tests_modules.py ================================================================== --- gc_lang/fr/modules/tests_modules.py +++ gc_lang/fr/modules/tests_modules.py @@ -20,11 +20,11 @@ start = time.perf_counter() try: yield finally: end = time.perf_counter() - print('{:<20} : {}'.format(label, end - start)) + print('{:<20} : {}'.format(label, end-start)) if hDst: hDst.write("{:<12.6}".format(end-start)) class TestDictionary (unittest.TestCase): @@ -40,16 +40,20 @@ def test_lookup_failed (self): for sWord in ["Branche", "BRANCHE", "BranchE", "BRanche", "BRAnCHE", "émilie"]: self.assertFalse(self.oDic.lookup(sWord), sWord) + def test_isvalidtoken (self): + for sWord in ["Branche", "branche", "BRANCHE", "Émilie", "ÉMILIE", "aujourd'hui", "aujourd’hui", "Aujourd'hui", "Aujourd’hui", "je-suis-vraiment-fatigué", ""]: + self.assertTrue(self.oDic.isValidToken(sWord), sWord) + def test_isvalid (self): - for sWord in ["Branche", "branche", "BRANCHE", "Émilie", "ÉMILIE", "aujourd'hui", "aujourd’hui", "Aujourd'hui", "Aujourd’hui"]: + for sWord in ["Branche", "branche", "BRANCHE", "Émilie", "ÉMILIE", "aujourd’hui", "Aujourd’hui"]: self.assertTrue(self.oDic.isValid(sWord), sWord) def test_isvalid_failed (self): - for sWord in ["BranchE", "BRanche", "BRAnCHE", "émilie", "éMILIE", "émiLie"]: + for sWord in ["BranchE", "BRanche", "BRAnCHE", "émilie", "éMILIE", "émiLie", "aujourd'hui", "Aujourd'hui", ]: self.assertFalse(self.oDic.isValid(sWord), sWord) def test_suggest (self): for sWord in [ "déelirranttesss", "vallidasion", "Emilie", "exibission", "ditirembique", "jai", "email",