diff options
author | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-20 19:07:51 +0300 |
commit | 95408b1a41b31b645f3a8c3323ab7d3ca4bff26b (patch) | |
tree | f8f137cddcb9a40499d303be95722fd2c6081bce /main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs | |
parent | b70e4e04b4e41b8ec28d7e4b220b401ecf467e7a (diff) | |
parent | de043d330a8bf5855d4d983c804cd36727cb2406 (diff) |
Merge remote-tracking branch 'origin/roslyn' into new-project-model
Diffstat (limited to 'main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs')
-rw-r--r-- | main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs index 0bfcf65a86..f044049d3d 100644 --- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs +++ b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs @@ -29,6 +29,7 @@ using System; using System.Text; using NUnit.Framework; +using Mono.TextEditor.Utils; namespace Mono.TextEditor.Tests { @@ -38,10 +39,10 @@ namespace Mono.TextEditor.Tests [Test()] public void TestLastLineCreation () { - IBuffer buffer = new Mono.TextEditor.GapBuffer (); + var buffer = new Rope<char> (); LineSplitter splitter = new Mono.TextEditor.LineSplitter (); - buffer.Text = "1\n2\n3\n"; - splitter.TextReplaced (null, new DocumentChangeEventArgs (0, "", buffer.Text)); + buffer.InsertText (0, "1\n2\n3\n"); + splitter.TextReplaced (null, new DocumentChangeEventArgs (0, "", buffer.ToString ())); Assert.AreEqual (4, splitter.Count); for (int i = 0; i < 3; i++) { Assert.AreEqual (i * 2, splitter.Get (i + 1).Offset); @@ -58,13 +59,13 @@ namespace Mono.TextEditor.Tests [Test()] public void TestLastLineRemove () { - IBuffer buffer = new Mono.TextEditor.GapBuffer (); + var buffer = new Rope<char> (); LineSplitter splitter = new Mono.TextEditor.LineSplitter (); - buffer.Text = "1\n2\n3\n"; - splitter.TextReplaced (null, new DocumentChangeEventArgs (0, "", buffer.Text)); + buffer.InsertText (0, "1\n2\n3\n"); + splitter.TextReplaced (null, new DocumentChangeEventArgs (0, "", buffer.ToString ())); DocumentLine lastLine = splitter.Get (2); - splitter.TextReplaced (null, new DocumentChangeEventArgs (lastLine.Offset, buffer.GetTextAt (lastLine.Offset, lastLine.LengthIncludingDelimiter), "")); + splitter.TextReplaced (null, new DocumentChangeEventArgs (lastLine.Offset, buffer.ToString (lastLine.Offset, lastLine.LengthIncludingDelimiter), "")); Assert.AreEqual (3, splitter.Count); |