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@xamarin.com>2014-02-21 11:52:20 +0400
committerMike Krüger <mkrueger@xamarin.com>2014-02-21 11:52:20 +0400
commitdef2d2787dabbb42dca49c39c162a15ecf192128 (patch)
treebdf114f1cf583eab2cbb794ae8101b0bacef0629 /main/tests
parent765e41a77257a0630d3ef828bb082bc847e36c88 (diff)
Fixed 'Bug 17896 - Adding line break inside string removes forward
whitespace.'.
Diffstat (limited to 'main/tests')
-rw-r--r--main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs26
1 files changed, 23 insertions, 3 deletions
diff --git a/main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs b/main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs
index 5874424eab..16270bb7ef 100644
--- a/main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs
+++ b/main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs
@@ -157,8 +157,12 @@ namespace MonoDevelop.CSharpBinding
int idx = output.IndexOf ('$');
if (idx > 0)
output = output.Substring (0, idx) + output.Substring (idx + 1);
- if (output != data.Text)
+ if (output != data.Text) {
+ Console.WriteLine ("expected:");
+ Console.WriteLine (output.Replace ("\t", "\\t").Replace (" ", "."));
+ Console.WriteLine ("was:");
Console.WriteLine (data.Text.Replace ("\t", "\\t").Replace (" ", "."));
+ }
Assert.AreEqual (output, data.Text);
Assert.AreEqual (idx, data.Caret.Offset, "Caret offset mismatch.");
}
@@ -237,16 +241,32 @@ namespace MonoDevelop.CSharpBinding
[Test]
public void TestStringContination ()
{
- var data = Create ("\t\t\"Hello$ World\"");
+ var data = Create ("\t\t\"Hello$World\"");
MiscActions.InsertNewLine (data);
- var engine = new CSharpTextEditorIndentation () {
+ var engine = new CSharpTextEditorIndentation {
wasInStringLiteral = true
};
CheckOutput (data, "\t\t\"Hello\" +" + eolMarker + "\t\t\"$World\"", engine);
}
/// <summary>
+ /// Bug 17896 - Adding line break inside string removes forward whitespace.
+ /// </summary>
+ [Test]
+ public void TestBug17896 ()
+ {
+ var data = Create ("\t\t\"This is a long test string.$ It contains spaces.\"");
+ MiscActions.InsertNewLine (data);
+
+ var engine = new CSharpTextEditorIndentation {
+ wasInStringLiteral = true
+ };
+ CheckOutput (data, "\t\t\"This is a long test string.\" +" + eolMarker + "\t\t\"$ It contains spaces.\"", engine);
+ }
+
+
+ /// <summary>
/// Bug 3214 - Unclosed String causes 'Enter' key to produce appended String line.
/// </summary>
[Test]