From: Christian Heller Date: Fri, 23 Jan 2026 00:57:18 +0000 (+0100) Subject: For testing comparisons, fix JS-generated HTML all crammed into single line. X-Git-Url: https://plomlompom.com/repos/booking/%7B%7Bdb.prefix%7D%7D/%7B%7Bprefix%7D%7D/%7B%7B%20web_path%20%7D%7D/decks/processes?a=commitdiff_plain;p=ledgplom For testing comparisons, fix JS-generated HTML all crammed into single line. --- diff --git a/src/ledgplom/testing.py b/src/ledgplom/testing.py index beb83c9..91ea595 100644 --- a/src/ledgplom/testing.py +++ b/src/ledgplom/testing.py @@ -13,6 +13,7 @@ from plomlib.web import PlomHttpServer _EXT_DAT = '.dat' _PATH_TESTS = Path('tests') +_TAGS_EXPANDED = ('', ' None: @@ -41,18 +42,25 @@ def run_tests() -> None: lines_expected = tuple(line.rstrip('\n') for line in f.readlines()) msg_prefix = f'test for {test_path}:' - for idx0, line in enumerate(lines_rendered): + for idx0, line in enumerate(lines_expected): idx1 = idx0 + 1 + if line in _TAGS_EXPANDED: + lines_rendered[idx0:idx0] = [line] + if line[1] != '/': + lines_rendered[idx1:idx1+1]\ + = lines_rendered[idx1].replace('><', '>\n<' + ).splitlines() + continue abort_msg = '' - if idx1 > len(lines_expected): - abort_msg = f'only {idx0} lines expected' - elif lines_expected[idx0] != line: - abort_msg = ('line differs, expected: ' - f'[{lines_expected[idx0]}]') + if idx1 > len(lines_rendered): + abort_msg = 'more lines expected' + elif lines_rendered[idx0] != line: + abort_msg = ('line differs, found instead: ' + f'[{lines_rendered[idx0]}]') if abort_msg: fail(abort_msg, msg_prefix, idx1) - if len(lines_expected) > idx1: - fail(f'more lines expected line {idx1}', msg_prefix, None) + if len(lines_rendered) > idx1: + fail('more lines rendered', msg_prefix, None) print(f'{msg_prefix} passed') pw.stop() server.shutdown() diff --git a/src/tests/full.edit_structured.1 b/src/tests/full.edit_structured.1 index 6e525d7..9faa0c6 100644 --- a/src/tests/full.edit_structured.1 +++ b/src/tests/full.edit_structured.1 @@ -102,7 +102,68 @@ to
-
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+
Gap:
diff --git a/src/tests/full.edit_structured.4 b/src/tests/full.edit_structured.4 index 3e79ac6..9df28c9 100644 --- a/src/tests/full.edit_structured.4 +++ b/src/tests/full.edit_structured.4 @@ -108,7 +108,112 @@ to
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+
Gap: