Skip to content

Commit

Permalink
added SCP service test, ref. #4460 (passes)
Browse files Browse the repository at this point in the history
  • Loading branch information
retailcoder committed Oct 26, 2018
1 parent e8564b4 commit 5e42b68
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private CodeString HandleOpeningChar(SelfClosingPair pair, CodeString original)
var line = lines[original.CaretPosition.StartLine];

string newCode;
if (string.IsNullOrEmpty(original.Code))
if (string.IsNullOrEmpty(line))
{
newCode = autoCode;
}
Expand Down
16 changes: 16 additions & 0 deletions RubberduckTests/AutoComplete/SelfClosingPairCompletionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,22 @@ public void DeletingOpeningChar_IndexExpr()
Assert.AreEqual(expected, result);
}

[Test] // ref. #4460
public void OpeningOnSecondLineDoesNotJumpToEndOfLine()
{
var pair = new SelfClosingPair('"', '"');
var input = '"';
var original = @"
ExecuteStoredProcedure (""AddAppointmentCountForAClinic"", False,dbconfig.SQLConString, _
| thisClinic.ClinicID ,".ToCodeString();
var expected = @"
ExecuteStoredProcedure (""AddAppointmentCountForAClinic"", False,dbconfig.SQLConString, _
""|"" thisClinic.ClinicID ,".ToCodeString();

var result = Run(pair, original, input);
Assert.AreEqual(expected, result);
}

[Test]
public void DeletingOpeningCharRemovesPairedClosingChar_NestedParensMultiline()
{
Expand Down

0 comments on commit 5e42b68

Please sign in to comment.