def test_automata (self): full = deque(open(TEST_FILE).readlines()) while full: a = full.popleft() b = full.popleft() res = self.get_type(cpy.lex(a)) self.assertEquals( b.split(), res)
def test_identifier(self): res = cpy.lex ("void c_function (void);") self.assertEquals([ t.type for t in res ] , ['VOID', 'IDENTIFIER', '(', 'VOID', ')', ';'])
def test_lex (self): self.assertNotEquals (0, len(cpy.lex ("void c_function (void);") ) )