Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Krüger <mkrueger@novell.com>2011-03-28 13:48:22 +0400
committerMike Krüger <mkrueger@novell.com>2011-03-28 13:50:38 +0400
commitafd4b69482a4abe652baf11f53df847d8114a433 (patch)
treedeeee7b4f7e50fed7a1b6fe795eab67b461e7493 /main/tests
parentdd71426e2cdeff202d03712203e5aea9a3c6e6d1 (diff)
Corrected some folding bugs & added them to the unit tests.
Diffstat (limited to 'main/tests')
-rw-r--r--main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs35
1 files changed, 34 insertions, 1 deletions
diff --git a/main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs b/main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs
index cbfb390911..196d08c71f 100644
--- a/main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs
+++ b/main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs
@@ -61,7 +61,7 @@ namespace Mono.TextEditor.Tests
foldSegments.Push (segment);
} else if (ch == ']' && foldSegments.Count > 0) {
FoldSegment segment = foldSegments.Pop ();
- segment.Length = i - segment.Offset + 1;
+ segment.Length = i - segment.Offset;
result.Add (segment);
}
}
@@ -197,5 +197,38 @@ namespace Mono.TextEditor.Tests
Assert.AreEqual (13, document.VisualToLogicalLine (5));
Assert.AreEqual (18, document.VisualToLogicalLine (8));
}
+
+ [Test()]
+ public void TestCaretRight ()
+ {
+ var data = CaretMoveActionTests.Create (
+@"1234567890
+1234567890
+123$4+[567890
+1234]567890
+1234567890");
+ data.Document.UpdateFoldSegments (GetFoldSegments (data.Document), false);
+ CaretMoveActions.Right (data);
+ Assert.AreEqual (new DocumentLocation (3, 5), data.Caret.Location);
+ CaretMoveActions.Right (data);
+ Assert.AreEqual (new DocumentLocation (4, 6), data.Caret.Location);
+ }
+
+ [Test()]
+ public void TestCaretLeft ()
+ {
+ var data = CaretMoveActionTests.Create (
+@"1234567890
+1234567890
+1234+[567890
+1234]5$67890
+1234567890");
+ data.Document.UpdateFoldSegments (GetFoldSegments (data.Document), false);
+ CaretMoveActions.Left (data);
+ Assert.AreEqual (new DocumentLocation (4, 6), data.Caret.Location);
+ CaretMoveActions.Left (data);
+ Assert.AreEqual (new DocumentLocation (3, 5), data.Caret.Location);
+ }
+
}
}