Coverage for tests/test_default_role_re.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2023-11-24 18:46 +0100

1from sphinxlint import rst 

2 

3 

4def 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 

9def 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 )