summaryrefslogtreecommitdiff
path: root/tests/test_utils.py
diff options
context:
space:
mode:
authorkmvanbrunt <kmvanbrunt@gmail.com>2018-11-15 15:22:17 -0500
committerGitHub <noreply@github.com>2018-11-15 15:22:17 -0500
commit61da7e5f7887f0d163c5d41abcae1209d3ad3580 (patch)
treee2c4610ea6da0cca3d4c38eddd8c610a363c365f /tests/test_utils.py
parentb6c39365e0331ab64aad074565fe73fb074a3a7f (diff)
parentbced087d58ec5a7e0ad5e8d7c3af6e6e84df56ef (diff)
downloadcmd2-git-61da7e5f7887f0d163c5d41abcae1209d3ad3580.tar.gz
Merge pull request #597 from python-cmd2/display_width
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)