From: Christian Heller Date: Thu, 2 Oct 2025 20:58:32 +0000 (+0200) Subject: Fix tests crashing on empty lines in anchored regions. X-Git-Url: https://plomlompom.com/repos/?a=commitdiff_plain;h=beee26ec3a24d880c785b454f5448d0748d800f9;p=ircplom Fix tests crashing on empty lines in anchored regions. --- diff --git a/src/ircplom/testing.py b/src/ircplom/testing.py index c8bfdd6..fca3765 100644 --- a/src/ircplom/testing.py +++ b/src/ircplom/testing.py @@ -144,9 +144,9 @@ class _Playbook: if len(range_data) == 2: return inserts for jdx, insert in enumerate(inserts): - context, msg = self._split_by_context_separator(insert) - if context == _CHAR_ANCHOR: + if (not insert) or insert.startswith(_CHAR_ANCHOR): continue + context, msg = self._split_by_context_separator(insert) inserts[jdx] = _CHAR_CONTEXT_SEP.join([range_data[2]] + [msg]) return inserts