Coverage for tests/test_default_role_re.py: 100%

1 from sphinxlint import rst

2

3

4 def test_shall_pass():

5 assert rst.INTERPRETED_TEXT_RE.search("foo `bar` baz")["inline_markup"] == "`bar`"

6 assert rst.INTERPRETED_TEXT_RE.search("foo `bar`-baz")["inline_markup"] == "`bar`"

7

8

9 def test_shall_not_pass():

10 assert not rst.INTERPRETED_TEXT_RE.search("foo `bar`baz")

11 assert not rst.INTERPRETED_TEXT_RE.search("foo '`'bar'`' baz")

12 assert not rst.INTERPRETED_TEXT_RE.search("``")

13 assert not rst.INTERPRETED_TEXT_RE.search("2 * x a ** b (* BOM32_* ` `` _ __ |")

14 assert not rst.INTERPRETED_TEXT_RE.search(

15 """"`" '|' (`) [`] {`} <`> ‘`’ ‚`‘ ‘`‚ ’`’ ‚`’ “`” „`“ “`„ ”`” „`” »`« ›`‹ «`» »`» ›`›"""

16 )