Skip to content

Commit 3746fdb

Browse files
committed
added test for matched pair deletion
1 parent a5480c9 commit 3746fdb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

RubberduckTests/AutoComplete/SelfClosingPairHandlerTests.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,19 @@ public void GivenOpeningParenthesisOnOtherwiseNonEmptyLine_ReturnsFalseAndSwallo
100100
var info = new SelfClosingPairTestInfo(original, input, rePrettified);
101101

102102
Assert.IsFalse(Run(info));
103-
Assert.IsNull(info.Result);
104103
Assert.IsTrue(info.Args.Handled);
105104
}
105+
106+
[Test]
107+
public void GivenBackspaceOnMatchedPair_DeletesMatchingTokens()
108+
{
109+
var input = '\b';
110+
var original = "foo = DateSerial(Year(|))".ToCodeString();
111+
var rePrettified = "foo = DateSerial(Year|)".ToCodeString();
112+
var info = new SelfClosingPairTestInfo(original, input, rePrettified);
113+
114+
Assert.IsTrue(Run(info));
115+
Assert.IsNotNull(info.Result);
116+
}
106117
}
107118
}

0 commit comments

Comments
 (0)