Beispiel #1
0
 def testSabeQualSeuAlpha(self):
   producao = Producao('A', 'abN')
   self.assertEqual('A', producao.obterAlpha())
Beispiel #2
0
 def testNaoSaoIguaisSeNaoPossuemMesmoBeta(self):
   producao1 = Producao('A', 'abN')
   producao2 = Producao('A', 'abn')
   self.assertEqual(producao1.obterAlpha(), producao2.obterAlpha())
   self.assertNotEqual(producao1.obterBeta(), producao2.obterBeta())
   self.assertNotEqual(producao1, producao2)
Beispiel #3
0
 def testSabeQualNaoEhSeuBeta(self):
   producao = Producao('A', 'abN')
   self.assertNotEqual('aBN', producao.obterBeta())
Beispiel #4
0
 def testSeNaoExisteSimboloNoIndiceInformadoRetornaNone(self):  
   p = Producao('B', 'a <ABACATE> N b')
   self.assertEqual(None, p.obterSimboloBeta(4))
Beispiel #5
0
 def testSabeDizerQuantosSimbolosExistemNoBetaDaProducao(self):
   p = Producao('B', 'a <ABACATE> N b')
   self.assertEqual(4, p.obterTamanhoBeta())
Beispiel #6
0
 def testDadoUmIndiceSabeDizerQualSimboloSeEncontraNaquelaPosicaoNoBetaDaProducao(self):
   p = Producao('B', 'a <ABACATE> N b')
   self.assertEqual('a', p.obterSimboloBeta(0))
   self.assertEqual('<ABACATE>', p.obterSimboloBeta(1))
   self.assertEqual('N', p.obterSimboloBeta(2))
   self.assertEqual('b', p.obterSimboloBeta(3))