home · contact · privacy
Fix tests crashing on empty lines in anchored regions.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 2 Oct 2025 20:58:32 +0000 (22:58 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 2 Oct 2025 20:58:32 +0000 (22:58 +0200)
src/ircplom/testing.py

index c8bfdd6cc2de48b06e1d9cd2db012127155827fb..fca3765b176a6437ec90e6a12b87c7ccc6468eba 100644 (file)
@@ -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