def testDadaUmaGLCEpsilonLivreSeTransformarEmEpsilonLivreRetornaAMesmaGramatica(self): self.assertEqual(construirGLCComABOndeNumAsEhIgualNumBsEpsilonLivre(), util.transformar_em_epsilon_livre_glc(construirGLCComABOndeNumAsEhIgualNumBsEpsilonLivre())) self.assertEqual(construirGLCExpAritmeticaComRecEsquerdaDireta(), util.transformar_em_epsilon_livre_glc(construirGLCExpAritmeticaComRecEsquerdaDireta()))
def testDadaUmaGLCNaoEpsilonLivrePodeRetornarUmaGLCEpsilonLivre(self): glc_ok = construirGLCComABOndeNumAsEhIgualNumBsEpsilonLivre() glc_nok = construirGLCComABOndeNumAsEhIgualNumBsComEpsilon() self.assertNotEqual(glc_ok, glc_nok) self.assertEqual(glc_ok, util.transformar_em_epsilon_livre_glc(glc_nok))