summaryrefslogtreecommitdiff
path: root/tests/test_utils.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-11-15 15:12:01 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-11-15 15:12:01 -0500
commitbced087d58ec5a7e0ad5e8d7c3af6e6e84df56ef (patch)
treee2c4610ea6da0cca3d4c38eddd8c610a363c365f /tests/test_utils.py
parentb6c39365e0331ab64aad074565fe73fb074a3a7f (diff)
downloadcmd2-git-bced087d58ec5a7e0ad5e8d7c3af6e6e84df56ef.tar.gz
Added wrapper for wcswidth that removes ansi escape characters
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r--tests/test_utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 807bc0fd..2f4723e4 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -21,6 +21,11 @@ def test_strip_ansi():
assert base_str != ansi_str
assert base_str == cu.strip_ansi(ansi_str)
+def test_display_width():
+ base_str = HELLO_WORLD
+ ansi_str = Fore.GREEN + base_str + Fore.RESET
+ assert cu.display_width(ansi_str) != len(ansi_str)
+
def test_strip_quotes_no_quotes():
base_str = HELLO_WORLD
stripped = cu.strip_quotes(base_str)