From a0ca8bf89cd34f3e903e2d0f9073a0779ac3f1ed Mon Sep 17 00:00:00 2001 From: Feror Date: Tue, 2 Jun 2026 15:19:23 +0200 Subject: [PATCH] test(editor): stabilize dirty render measurement --- .../EditorLargeDocumentValidationTests.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Tests/SaplingEditorTests/EditorLargeDocumentValidationTests.swift b/Tests/SaplingEditorTests/EditorLargeDocumentValidationTests.swift index c483467..573c2ec 100644 --- a/Tests/SaplingEditorTests/EditorLargeDocumentValidationTests.swift +++ b/Tests/SaplingEditorTests/EditorLargeDocumentValidationTests.swift @@ -38,12 +38,11 @@ final class EditorLargeDocumentValidationTests: XCTestCase { previousActiveLineIndex: activeLineIndex, currentActiveLineIndex: activeLineIndex ) + let updatedLineIndex = DocumentLineIndex(source: updatedSource) let dirtyRenderMeasurement = elapsedTime { - let lines = EditorActiveLineTracker.lines(from: updatedSource, activeLineIndex: activeLineIndex) - let dirty = Set(plan.dirtyLineIndexes) let renderer = HybridMarkdownLineRenderer() - _ = lines - .filter { dirty.contains($0.index) } + _ = plan.dirtyLineIndexes + .compactMap { updatedLineIndex.editorLine(at: $0, activeLineIndex: activeLineIndex) } .map(renderer.renderPlan(for:)) }