From: Christian Heller Date: Sun, 25 Jan 2026 07:39:14 +0000 (+0100) Subject: For testing, ignore indentation in . X-Git-Url: https://plomlompom.com/repos/booking/static/%7B%7Bdb.prefix%7D%7D/%7B%7Bprefix%7D%7D/bar%20baz.html?a=commitdiff_plain;ds=inline;p=ledgplom For testing, ignore indentation in . --- diff --git a/src/ledgplom/testing.py b/src/ledgplom/testing.py index dbea816..5a7263b 100644 --- a/src/ledgplom/testing.py +++ b/src/ledgplom/testing.py @@ -45,11 +45,13 @@ def run_tests(selector: str) -> None: lines_expected = tuple(line.rstrip('\n') for line in f.readlines()) msg_prefix = f'test for {test_path}:' + in_expansion = False for idx0, line in enumerate(lines_expected): idx1 = idx0 + 1 if line in _TAGS_EXPANDED: lines_rendered[idx0:idx0] = [line] - if line[1] != '/': + in_expansion = line[1] != '/' + if in_expansion: lines_rendered[idx1:idx1+1]\ = lines_rendered[idx1].replace('><', '>\n<' ).splitlines() @@ -57,7 +59,8 @@ def run_tests(selector: str) -> None: abort_msg = '' if idx1 > len(lines_rendered): abort_msg = 'more lines expected' - elif lines_rendered[idx0] != line: + elif lines_rendered[idx0] != (line.lstrip() if in_expansion + else line): abort_msg = ('line differs, found instead: ' f'[{lines_rendered[idx0]}]') if abort_msg: diff --git a/src/tests/full.edit_structured.1 b/src/tests/full.edit_structured.1 index f091ec9..4d9fbb5 100644 --- a/src/tests/full.edit_structured.1 +++ b/src/tests/full.edit_structured.1 @@ -104,64 +104,64 @@ to
- - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - -
+ + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Gap:
diff --git a/src/tests/full.edit_structured.4 b/src/tests/full.edit_structured.4 index 7e71818..2626557 100644 --- a/src/tests/full.edit_structured.4 +++ b/src/tests/full.edit_structured.4 @@ -104,108 +104,108 @@ to
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - -
+ + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Gap:
diff --git a/src/tests/full.edit_structured.5 b/src/tests/full.edit_structured.5 index 1f031eb..b85a6e6 100644 --- a/src/tests/full.edit_structured.5 +++ b/src/tests/full.edit_structured.5 @@ -110,108 +110,108 @@ to
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - -
+ + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Gap: