summaryrefslogtreecommitdiff
path: root/tests/test_parsing.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-09-27 12:52:55 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-09-27 12:52:55 -0400
commit5ab1ab67f8a5814f342053b7b2430d49822a3ead (patch)
treee971ead52d3a8f9acaae7575b195b7099d6bf7b6 /tests/test_parsing.py
parent98a763c2e4d75bfb2d59738826f992d56a0d03c7 (diff)
downloadcmd2-git-5ab1ab67f8a5814f342053b7b2430d49822a3ead.tar.gz
Fixed bug in handling unicode digits in macro arguments
Diffstat (limited to 'tests/test_parsing.py')
-rw-r--r--tests/test_parsing.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_parsing.py b/tests/test_parsing.py
index 15da9b7a..1fa460a5 100644
--- a/tests/test_parsing.py
+++ b/tests/test_parsing.py
@@ -786,6 +786,10 @@ def test_macro_normal_arg_pattern():
matches = pattern.findall('{3} text {4} stuff {5}}}}')
assert matches == ['{3}', '{4}', '{5}']
+ # Unicode digit
+ matches = pattern.findall('{\N{ARABIC-INDIC DIGIT ONE}}')
+ assert matches == ['{\N{ARABIC-INDIC DIGIT ONE}}']
+
# Invalid strings
matches = pattern.findall('5')
assert not matches
@@ -832,6 +836,10 @@ def test_macro_escaped_arg_pattern():
matches = pattern.findall('{{3}} text {{4}} stuff {{5}}}}')
assert matches == ['{{3}}', '{{4}}', '{{5}}']
+ # Unicode digit
+ matches = pattern.findall('{{\N{ARABIC-INDIC DIGIT ONE}}}')
+ assert matches == ['{{\N{ARABIC-INDIC DIGIT ONE}}}']
+
# Invalid strings
matches = pattern.findall('5')
assert not matches