From b0e5aabad9c902ee5d664bf58885245060114f61 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Thu, 19 Dec 2019 17:00:29 -0500 Subject: Renamed ansi_safe_wcswidth() to style_aware_wcswidth() Renamed ansi_aware_write() to style_aware_write() --- tests/test_ansi.py | 4 ++-- tests/test_utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/test_ansi.py b/tests/test_ansi.py index 4f7ab652..2382c333 100644 --- a/tests/test_ansi.py +++ b/tests/test_ansi.py @@ -17,10 +17,10 @@ def test_strip_style(): assert base_str == ansi.strip_style(ansi_str) -def test_ansi_safe_wcswidth(): +def test_style_aware_wcswidth(): base_str = HELLO_WORLD ansi_str = ansi.style(base_str, fg='green') - assert ansi.ansi_safe_wcswidth(ansi_str) != len(ansi_str) + assert ansi.style_aware_wcswidth(ansi_str) != len(ansi_str) def test_style_none(): diff --git a/tests/test_utils.py b/tests/test_utils.py index 27b0e3bb..b5231172 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -349,7 +349,7 @@ def test_align_text_term_width(): fill_char = ' ' term_width = shutil.get_terminal_size().columns - expected_fill = (term_width - ansi.ansi_safe_wcswidth(text)) * fill_char + expected_fill = (term_width - ansi.style_aware_wcswidth(text)) * fill_char aligned = cu.align_text(text, fill_char=fill_char, alignment=cu.TextAlignment.LEFT) assert aligned == text + expected_fill -- cgit v1.2.1