コード例 #1
0
ファイル: test_runtime.py プロジェクト: bdauvergne/pymeta
 def test_end(self):
     """
     L{OMetaBase.rule_end} matches the end of input and raises L{_MaybeParseError}
     if input is left.
     """
     o = OMetaBase("abc")
     try:
         o.rule_end()
     except _MaybeParseError, e:
         self.assertEqual(e, _MaybeParseError(1, None))
コード例 #2
0
ファイル: test_runtime.py プロジェクト: pjogrady/pymeta3
 def test_end(self):
     """
     L{OMetaBase.rule_end} matches the end of input and raises L{_MaybeParseError}
     if input is left.
     """
     o = OMetaBase("abc")
     try:
         o.rule_end()
     except _MaybeParseError as e:
         self.assertEqual(e, _MaybeParseError(1, None))
     else:
         self.fail('_MaybeParseError not raised')
     o.many(o.rule_anything)
     self.assertEqual(o.rule_end(), (True, _MaybeParseError(3, None)))
コード例 #3
0
 def test_end(self):
     """
     L{OMetaBase.rule_end} matches the end of input and raises L{_MaybeParseError}
     if input is left.
     """
     o = OMetaBase("abc")
     try:
         o.rule_end()
     except _MaybeParseError as e:
         self.assertEqual(e, _MaybeParseError(1, None))
     else:
         self.fail('_MaybeParseError not raised')
     o.many(o.rule_anything)
     self.assertEqual(o.rule_end(), (True, _MaybeParseError(3, None)))
コード例 #4
0
ファイル: test_runtime.py プロジェクト: jskopek/pmtest
 def test_end(self):
     """
     L{OMetaBase.rule_end} matches the end of input and raises L{ParseError}
     if input is left.
     """
     o = OMetaBase("abc")
     e = self.assertRaises(ParseError, o.rule_end)
     self.assertEqual(e, ParseError(1, None))
     o.many(o.rule_anything)
     self.assertEqual(o.rule_end(), (True, [3, None]))
コード例 #5
0
 def test_end(self):
     """
     L{OMetaBase.rule_end} matches the end of input and raises L{ParseError}
     if input is left.
     """
     o = OMetaBase("abc")
     e = self.assertRaises(ParseError, o.rule_end)
     self.assertEqual(e, ParseError(1, None))
     o.many(o.rule_anything)
     self.assertEqual(o.rule_end(), (True, [3, None]))