Skip to content

Commit

Permalink
test for parse md
Browse files Browse the repository at this point in the history
  • Loading branch information
xufangt committed Nov 27, 2023
1 parent a3cefb8 commit f932c6a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from typing import Final

from mltb2.md import MdTextSplitter, _chunk_md_by_headline, chunk_md
from mltb2.md import MdTextSplitter, _chunk_md_by_headline, chunk_md, extract_text_from_markdown
from mltb2.transformers import TransformersTokenCounter

MD: Final[
Expand All @@ -28,6 +28,14 @@
#### Headline 4 / 2"""

def test_():
tests = [('## Basic list','Basic list'),
('* fruit', 'fruit'),
('> A single quote', 'A single quote'),
('[Link text Here](https://link-url-here.org)','Link text Here')]
for md_text, text in tests:
assert extract_text_from_markdown(md_text) == text


def test_chunk_md_by_headline():
result = _chunk_md_by_headline(MD)
Expand Down

0 comments on commit f932c6a

Please sign in to comment.