예제 #1
0
 def test_sequence_ok_two(self):
     c = char('c')
     ccc = sequence(c, c, c)
     stream = Stream('cccc')
     out, stream = ccc(stream)
     self.assertEqual(out, list('ccc'))
     self.assertEqual(stream.position, 3)
예제 #2
0
 def test_sequence_fails_two(self):
     c = char('c')
     ccc = sequence(c, c, c)
     stream = Stream('ccx')
     with self.assertRaises(ParseFailure):
         ccc(stream)