summaryrefslogtreecommitdiff
path: root/unitTests.py
diff options
context:
space:
mode:
authorPaul McGuire <ptmcg@austin.rr.com>2018-09-24 23:25:51 -0500
committerPaul McGuire <ptmcg@austin.rr.com>2018-09-24 23:25:51 -0500
commit54728a0f0c68c77272b8f5c9b82e3bcac12f8ee4 (patch)
treee7237235ff96daa5c19086bb165111e3917720e4 /unitTests.py
parent5241985c6eb694358995d82761cb4d05f448bcd8 (diff)
downloadpyparsing-git-54728a0f0c68c77272b8f5c9b82e3bcac12f8ee4.tar.gz
Issue #28, bug in SkipTo when skipping to an expr that saves as a list
Diffstat (limited to 'unitTests.py')
-rw-r--r--unitTests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/unitTests.py b/unitTests.py
index a31bf40..a165e39 100644
--- a/unitTests.py
+++ b/unitTests.py
@@ -985,6 +985,14 @@ class SkipToParserTests(ParseTestCase):
tryToParse('some text /* comment with ; in */; working')
tryToParse('some text /* comment with ; in */some other stuff; working', fail_expected=True)
+ # test that we correctly create named results
+ text = "prefixDATAsuffix"
+ data = Literal("DATA")
+ suffix = Literal("suffix")
+ expr = SkipTo(data + suffix)('prefix') + data + suffix
+ result = expr.parseString(text)
+ assert isinstance(result.prefix, str), "SkipTo created with wrong saveAsList attribute"
+
class CustomQuotesTest(ParseTestCase):
def runTest(self):
from pyparsing import QuotedString