File: test_markdown_lexers.py

package info (click to toggle)
python-sybil 9.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,148 kB
  • sloc: python: 4,510; makefile: 90
file content (17 lines) | stat: -rw-r--r-- 716 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

from sybil.parsers.markdown.lexers import RawFencedCodeBlockLexer
from sybil.region import Region
from .helpers import check_lexed_regions


def test_fenced_code_block():
    lexer = RawFencedCodeBlockLexer()
    check_lexed_regions('markdown-fenced-code-block.md', lexer, expected = [
        Region(12, 24, lexemes={'source': '<\n >\n'}),
        Region(34, 46, lexemes={'source': '<\n >\n'}),
        Region(177, 192, lexemes={'source': 'aaa\n~~~\n'}),
        Region(266, 285, lexemes={'source': 'aaa\n```\n'}),
        Region(301, 312, lexemes={'source': 'aaa\n'}),
        Region(296, 317, lexemes={'source': '~~~\naaa\n~~~\n'}),
        Region(397, 421, lexemes={'source': 'some stuff here\n~~~\n'}),
    ])