def test_003_string_terminal_empty(self): parser = PEGParser("") old_cur = self.text.cur self.assertEqual(parser(self.text), "") self.assertEqual(old_cur, self.text.cur)
def test_001_string_terminal(self): parser = PEGParser("dog") self.assertEqual(parser(self.text), "dog") self.assertEqual(self.text.cur, 3)
def tmp(): parser(self.text)
def test_002_zero_or_one__zero(self): parser = PEGParser(ZeroOrOne("fox")) self.assertEqual(parser(self.text), None) self.assertEqual(self.text.cur, 0)