diff options
author | ptmcg <ptmcg@austin.rr.com> | 2018-10-27 12:21:59 -0500 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2018-10-27 12:21:59 -0500 |
commit | cd761d30e64c1ecaf3518087efe2f96df052c4fc (patch) | |
tree | fe2ab5e5b3942ab47af11825f680da5347663fcd /unitTests.py | |
parent | ddd2ee7e9fcf5e5b7de6f1672d32ce8e5f94348d (diff) | |
download | pyparsing-git-cd761d30e64c1ecaf3518087efe2f96df052c4fc.tar.gz |
Add unicode character ranges by name
Diffstat (limited to 'unitTests.py')
-rw-r--r-- | unitTests.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/unitTests.py b/unitTests.py index 0780801..cc4db6f 100644 --- a/unitTests.py +++ b/unitTests.py @@ -3620,6 +3620,20 @@ class SetBreakTest(ParseTestCase): print_("After parsing with setBreak:", was_called)
self.assertTrue(bool(was_called), "set_trace wasn't called by setBreak")
+class UnicodeTests(ParseTestCase):
+ def runTest(self):
+ import pyparsing as pp
+
+ alphas = pp.pyparsing_unicode.Greek.alphas
+ greet = pp.Word(alphas) + ',' + pp.Word(alphas) + '!'
+
+ # input string
+ hello = "Καλημέρα, κόσμε!"
+ result = greet.parseString(hello)
+ print_(result)
+ self.assertTrue(result.asList() == ['Καλημέρα', ',', 'κόσμε', '!'],
+ "Failed to parse Greek 'Hello, World!' using pyparsing_unicode.Greek.alphas")
+
class MiscellaneousParserTests(ParseTestCase):
def runTest(self):
|