aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorbenadha <benawiadha@gmail.com>2022-01-15 14:07:52 +0700
committerbenadha <benawiadha@gmail.com>2022-01-15 14:07:52 +0700
commit75b5e6a04a116902703cc99d12889b10bcd23023 (patch)
tree7c64fe14788ff55210bd255eed7fe7ac1aa5a535 /tests
parentbde59b1d0eeac75301459331e76df337b06f6749 (diff)
downloadepy-75b5e6a04a116902703cc99d12889b10bcd23023.tar.gz
URL early support
Diffstat (limited to 'tests')
-rw-r--r--tests/test_text_parser.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_text_parser.py b/tests/test_text_parser.py
index 42a98d3..9573915 100644
--- a/tests/test_text_parser.py
+++ b/tests/test_text_parser.py
@@ -1,6 +1,15 @@
from epy import CharPos, TextMark, TextSpan, HTMLtoLines
+def test_text_mark_validation_check():
+ assert TextMark(start=CharPos(row=3, col=1), end=CharPos(row=3, col=5)).is_valid()
+ assert TextMark(start=CharPos(row=3, col=5), end=CharPos(row=3, col=5)).is_valid()
+ assert not TextMark(start=CharPos(row=3, col=5), end=CharPos(row=3, col=2)).is_valid()
+ assert TextMark(start=CharPos(row=3, col=5), end=CharPos(row=5, col=2)).is_valid()
+ assert not TextMark(start=CharPos(row=8, col=5), end=CharPos(row=5, col=2)).is_valid()
+ assert not TextMark(start=CharPos(row=0, col=3)).is_valid()
+
+
def test_mark_to_span():
text = [
"Lorem ipsum dolor sit amet,",