diff options
author | Paul McGuire <ptmcg@austin.rr.com> | 2016-08-11 07:38:46 +0000 |
---|---|---|
committer | Paul McGuire <ptmcg@austin.rr.com> | 2016-08-11 07:38:46 +0000 |
commit | 28b014ab32af09a19b2def30e003ecfb903dcab3 (patch) | |
tree | 4280cfa3d2bb14d5fd81af83690a384ce22a18b5 /src/unitTests.py | |
parent | 9c57a4241aa9d531de00f25ec3fe1723fe7268cc (diff) | |
download | pyparsing-git-28b014ab32af09a19b2def30e003ecfb903dcab3.tar.gz |
Add support for all iterables (sets, generators, etc.) to oneOf and ParseExpression
Diffstat (limited to 'src/unitTests.py')
-rw-r--r-- | src/unitTests.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/unitTests.py b/src/unitTests.py index dbcf5ae..9313778 100644 --- a/src/unitTests.py +++ b/src/unitTests.py @@ -2972,6 +2972,24 @@ class MiscellaneousParserTests(ParseTestCase): except RuntimeError:
assert False,"still have infinite loop in oneOf with duplicate symbols"
+ print_("verify oneOf handles generator input")
+ try:
+ test1 = pyparsing.oneOf(c for c in "a b c d a")
+ except RuntimeError:
+ assert False,"still have infinite loop in oneOf with duplicate symbols"
+
+ print_("verify oneOf handles list input")
+ try:
+ test1 = pyparsing.oneOf("a b c d a".split())
+ except RuntimeError:
+ assert False,"still have infinite loop in oneOf with duplicate symbols"
+
+ print_("verify oneOf handles set input")
+ try:
+ test1 = pyparsing.oneOf(set("a b c d a"))
+ except RuntimeError:
+ assert False,"still have infinite loop in oneOf with duplicate symbols"
+
# test MatchFirst bugfix
if "B" in runtests:
print_("verify MatchFirst iterates properly")
|