From: Christian Heller Date: Fri, 7 Nov 2025 20:56:17 +0000 (+0100) Subject: Change end-of-fragments marking in testing scripts to easen human and machine parsing. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/copy_structured?a=commitdiff_plain;h=33b31b1b496a4ee2c7f00b1c86ef62accc2700b2;p=ircplom Change end-of-fragments marking in testing scripts to easen human and machine parsing. --- diff --git a/src/ircplom/testing.py b/src/ircplom/testing.py index 4f56c18..a09dcd6 100644 --- a/src/ircplom/testing.py +++ b/src/ircplom/testing.py @@ -266,12 +266,13 @@ class _Playbook: fragments_cutoff = -1 for idx, line_t in enumerate(self._lines_t[:] + [('', '')]): if line_t[1].startswith(_MARK_FRAGMENT): + assert _SEP_0 in line_t[1], (idx, line_t) if anchor: fragments[anchor] = tuple(fragment) - if not line_t[1][len(_MARK_FRAGMENT):].rstrip(): + anchor = line_t[1].split(_SEP_0, maxsplit=1)[1] + if anchor.startswith(_MARK_FRAGMENT): fragments_cutoff = idx break - anchor = line_t[1].split(_SEP_0, maxsplit=1)[1] fragment.clear() continue fragment += [line_t] diff --git a/src/tests/_timeout_retries.test b/src/tests/_timeout_retries.test index cd2e24d..d5cb167 100644 --- a/src/tests/_timeout_retries.test +++ b/src/tests/_timeout_retries.test @@ -60,7 +60,7 @@ log 1 > CAP LS :302 log 1 > USER foobarbazquux 0 * :baz log 1 > NICK :foo -× +× ××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××× # NB: FakeIrcConnection on any port > 10000 will fail connecting with a timeout # the TestingClient meanwhile will decrement any port of that range by 1 after diff --git a/src/tests/connect_disconnect_legalities.test b/src/tests/connect_disconnect_legalities.test index 68dadfa..568a78c 100644 --- a/src/tests/connect_disconnect_legalities.test +++ b/src/tests/connect_disconnect_legalities.test @@ -26,7 +26,7 @@ log 2 $ DISCONNECTED servermsg 0 MSG log 1 < MSG -× +× ××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××× # to prepare, initiate connection > /connect foo.bar.baz foo bar:baz diff --git a/src/tests/error_disconnects.test b/src/tests/error_disconnects.test index 7a0e11b..f0d794a 100644 --- a/src/tests/error_disconnects.test +++ b/src/tests/error_disconnects.test @@ -38,7 +38,7 @@ insert reconnect insert servermsglogged : +0 MSG ERROR :XXX log 1 $ connection_state set to: [XXX] -× +× ××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××× # to prepare first test, initiate connected state > /connect foo.bar.baz foo bar:baz diff --git a/src/tests/pingpong.test b/src/tests/pingpong.test index 1c03b54..8f7c7c5 100644 --- a/src/tests/pingpong.test +++ b/src/tests/pingpong.test @@ -41,7 +41,7 @@ log 1 $ will retry connecting in 1 seconds servermsg 0 timeout log 1 > PING :what's up? -× +× ××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××× > /connect foo.bar.baz foo:bar baz:foobarbazquux insert isupport-clear diff --git a/src/tests/test.test b/src/tests/test.test index b8852f6..5be974b 100644 --- a/src/tests/test.test +++ b/src/tests/test.test @@ -272,7 +272,7 @@ insert isupport-clear : +8 log 8 $ connection_state set to: [] log , $ DISCONNECTED -× +× ××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××× # on /connect init databases, log in new windows > /connect foo.bar.baz foo:bar baz:foobarbazquux diff --git a/src/tests/tui_draw.test b/src/tests/tui_draw.test index 74686bf..ce7b38d 100644 --- a/src/tests/tui_draw.test +++ b/src/tests/tui_draw.test @@ -181,7 +181,7 @@ insert lines-ping-pong : +73 ?? 21 insert lines-ping-pong : +75 ?? 22 insert lines-ping-pong : +77 ?? 23 -× +× ××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××× insert lines-empty insert lines-status-prompt-start : +22 X123456789X123456789X =================([0] diff --git a/src/tests/tui_line_formattings.test b/src/tests/tui_line_formattings.test index 86b543a..27a93db 100644 --- a/src/tests/tui_line_formattings.test +++ b/src/tests/tui_line_formattings.test @@ -2,7 +2,7 @@ servermsg 0 MSG log 1 < MSG -× +× ××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××× > /connect foo.bar.baz foo bar:baz log 1 $ isupport cleared