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-30 14:54:56 +0400
committerMike Krüger <mkrueger@novell.com>2011-03-30 14:54:56 +0400
commit521a818e94f15e2991d522334e88064219a9bec7 (patch)
tree8f2fd8e8edd0e101e163bceeac90facd978a089e /main/tests
parente018428edaedcd82534ddf235a8a43ed5a1dcbac (diff)
Fixed folding update bug.
Diffstat (limited to 'main/tests')
-rw-r--r--main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs b/main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs
index 196d08c71f..052d8767d5 100644
--- a/main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs
+++ b/main/tests/UnitTests/Mono.TextEditor.Tests/FoldingTests.cs
@@ -230,5 +230,36 @@ namespace Mono.TextEditor.Tests
Assert.AreEqual (new DocumentLocation (3, 5), data.Caret.Location);
}
+
+ [Test()]
+ public void TestUpdateFoldSegmentBug2 ()
+ {
+ Document document = new Mono.TextEditor.Document ();
+ document.Text =
+@"-[0
+1
++[2
+3]
+4
++[5
+6]
+7
+8
+9
+10
+11
+12
+13]
+14
+15";
+ var segments = GetFoldSegments (document);
+ document.UpdateFoldSegments (segments, false);
+ Assert.AreEqual (10, document.VisualToLogicalLine (8));
+ int start = document.GetLine (2).Offset;
+ int end = document.GetLine (8).Offset;
+ ((IBuffer)document).Remove (start, end - start);
+ Assert.AreEqual (10, document.LogicalToVisualLine (10));
+ }
+
}
}