Skip to content

Commit

Permalink
test_modules_choose: we'll aspire to fix these XFAIL tests someday
Browse files Browse the repository at this point in the history
  • Loading branch information
dgw committed Oct 19, 2020
1 parent 1f1c32c commit da02739
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/modules/test_modules_choose.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,36 @@
def test_format_safe(text, cleaned):
"""Test expected formatting-safe string sanitization."""
assert choose._format_safe(text) == cleaned


# --- Insert reset only when necessary | Expected to fail --- #

EFFICIENT_PAIRS = (
# whitespace inside formatting (kept)
('\x02 leading space inside formatting\x02',
'\x02 leading space inside formatting\x02'),
('\x02trailing space inside formatting \x02',
'\x02trailing space inside formatting \x02'),
('\x02 leading AND trailing inside formatting \x02',
'\x02 leading AND trailing inside formatting \x02'),
# whitespace outside formatting (dropped)
(' \x02leading space outside formatting\x02',
'\x02leading space outside formatting\x02'),
('\x02trailing space outside formatting\x02 ',
'\x02trailing space outside formatting\x02'),
# whitespace both inside and outside formatting
# (respectively kept and dropped)
(' \x02 leading space inside AND outside\x02',
'\x02 leading space inside AND outside\x02'),
('\x02trailing space inside AND outside \x02 ',
'\x02trailing space inside AND outside \x02'),
(' \x02 leading AND trailing inside AND outside \x02 ',
'\x02 leading AND trailing inside AND outside \x02'),
)


@pytest.mark.parametrize('text, cleaned', EFFICIENT_PAIRS)
@pytest.mark.xfail(strict=True)
def test_format_safe_future(text, cleaned):
"""Test future aspirations of efficiency."""
assert choose._format_safe(text) == cleaned

0 comments on commit da02739

Please sign in to comment.