File: test_carets_utils.py

package info (click to toggle)
python-friendly-traceback 0.7.62%2Bgit20240811.d7dbff6-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,264 kB
  • sloc: python: 21,500; makefile: 4
file content (11 lines) | stat: -rw-r--r-- 462 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
from friendly_traceback.utils import get_single_line_highlighting_ranges as get
from friendly_traceback.utils import create_caret_highlighted as create

def test_round_trip():
    lines = [" ^^ ^^^ ^^",  # start on space, end on ^
             " ^^ ^^^ ^ ",  # start on space, end on space
             "^^ ^^^ ^",    # start on ^, end on ^
             "^^ ^^^ ^  ",]  # start on ^, end on space

    for line in lines:
        assert line == create(get(line))