From 89b87efa599acb62a9e91bd49ffd56a7ea9dad83 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Tue, 1 Apr 2025 22:50:55 +0100 Subject: [PATCH] Fix tests --- backend/reconcile/src/operation_transformation.rs | 12 ++++++------ ...on__edited_text__tests__calculate_operations.snap | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/reconcile/src/operation_transformation.rs b/backend/reconcile/src/operation_transformation.rs index 0674a254..4338ca6e 100644 --- a/backend/reconcile/src/operation_transformation.rs +++ b/backend/reconcile/src/operation_transformation.rs @@ -292,7 +292,7 @@ mod test { }, CursorPosition { id: 1, - char_index: 0 + char_index: 1 } ] ) @@ -336,18 +336,18 @@ mod test { TextWithCursors::new( "that was really complex sample for testing cursor movements", vec![ + CursorPosition { + id: 2, + char_index: 5 + }, // unchanged CursorPosition { id: 0, char_index: 9 }, // before "really" CursorPosition { id: 1, - char_index: 25 + char_index: 23 }, // inside of "s|ample" because "text" got replaced by "sample" - CursorPosition { - id: 2, - char_index: 5 - }, // unchanged CursorPosition { id: 3, char_index: 31 diff --git a/backend/reconcile/src/operation_transformation/snapshots/reconcile__operation_transformation__edited_text__tests__calculate_operations.snap b/backend/reconcile/src/operation_transformation/snapshots/reconcile__operation_transformation__edited_text__tests__calculate_operations.snap index 0630f986..f08083f4 100644 --- a/backend/reconcile/src/operation_transformation/snapshots/reconcile__operation_transformation__edited_text__tests__calculate_operations.snap +++ b/backend/reconcile/src/operation_transformation/snapshots/reconcile__operation_transformation__edited_text__tests__calculate_operations.snap @@ -23,4 +23,5 @@ EditedText { operation: , }, ], + cursors: [], }