Skip to content

Commit 10a677a

Browse files
committed
add test for strip_math
1 parent ffb8969 commit 10a677a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/tests/test_cbook.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,12 @@ def test_safe_first_element_with_none():
918918
assert actual is not None and actual == datetime_lst[1]
919919

920920

921+
def test_strip_math():
922+
assert strip_math(r'1 \times 2') == r'1 \times 2'
923+
assert strip_math(r'$1 \times 2$') == '1 x 2'
924+
assert strip_math(r'$\rm{hi}$') == 'hi'
925+
926+
921927
@pytest.mark.parametrize('fmt, value, result', [
922928
('%.2f m', 0.2, '0.20 m'),
923929
('{:.2f} m', 0.2, '0.20 m'),

0 commit comments

Comments
 (0)