aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest/test_formatting.py
blob: c35b70eee0798f9b3bd746079e3d326418ef7f38 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pytest

import wee_slack


@pytest.mark.parametrize("text", [
    """
    * an item
    * another item
    """,
    "* Run this command: `find . -name '*.exe'`",
])
def test_does_not_format(text):
    assert wee_slack.render_formatting(text) == text


@pytest.mark.parametrize("text", [
    "`hello *bar*`",
    "`*`",
    "`* *`",
    "`* * *`",
    "`* * * *`",
    "`* * * * *`",
    "`* * * * * *`",
])
def test_preserves_format_chars_in_code(text):
    assert wee_slack.render_formatting(text) == text