From 5d91fcba5f806730026ddf20eb7274b0d2483fa8 Mon Sep 17 00:00:00 2001 From: rootile Date: Tue, 9 Jun 2026 15:56:13 +0200 Subject: [PATCH] fix(f2/repl): accept tests should not replace delimiter on updates Change-Id: I468bf84af1b4a5dab34e186c55830e11ba9b9474 --- tests/functional2/testlib/repl_util.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/functional2/testlib/repl_util.py b/tests/functional2/testlib/repl_util.py index 6aab703ad..206585afb 100644 --- a/tests/functional2/testlib/repl_util.py +++ b/tests/functional2/testlib/repl_util.py @@ -132,11 +132,16 @@ class ReplTest: # HACK(rootile, 2026-05): The \n is required due to the renderer seeming to have an off-by-one error resulting in the deletion of the last character :melt: appendix = "" if actual.endswith("\n") else "\n" expected.children[0].content = actual + appendix + delimiter = expected.delimiter[0] delimiter_length = ( - max(len(line) for line in actual.splitlines() if all(c == "`" for c in line)) + max( + len(line) + for line in actual.splitlines() + if all(c == delimiter for c in line) + ) + 1 ) - expected.delimiter = "`" * max(delimiter_length, 3) + expected.delimiter = delimiter * max(delimiter_length, 3) return updated def _output_to_blocks(self, output: str) -> list[tuple[str, ReplTestBlock]]: