~therve/pyparsing/pep8

« back to all changes in this revision

Viewing changes to test_pyparsing.py

  • Committer: Thomas Hervé
  • Date: 2012-03-17 18:51:39 UTC
  • Revision ID: thomas@canonical.com-20120317185139-uqsayep7xq8mnov0
Test include and fix a possible bug

Show diffs side-by-side

added added

removed removed

Lines of Context:
710
710
            "Found expression 'bar' (at char 0), (line:1, col:1)",
711
711
            str(error))
712
712
 
713
 
    def test_ignore(self):
714
 
        skip = SkipTo(Literal("foo"), ignore=Literal("b"))
 
713
    def test_include(self):
 
714
        skip = SkipTo(Literal("foo"), include=True)
715
715
        tokens = skip.parseString("bar foo daz bar")
716
 
        self.assertEqual(["bar "], tokens.asList())
 
716
        self.assertEqual(["bar ", "foo"], tokens.asList())