Skip to content

Commit bb1b1dd

Browse files
committed
Add test per review comments
1 parent 521146e commit bb1b1dd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

RubberduckTests/Inspections/AssignmentNotUsedInspectionTests.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,27 @@ End Function
789789
Assert.AreEqual(expected, results.Count());
790790
}
791791

792+
[Test]
793+
public void ResumeStmt_SingleResult()
794+
{
795+
string code =
796+
$@"
797+
Public Function Inverse(value As Double) As Double
798+
On Error GoTo ErrorHandler:
799+
Dim ratio As Double
800+
ratio = 0# '<== unused
801+
ratio = 1# / value '<== used
802+
Inverse = ratio
803+
Exit Function
804+
ErrorHandler:
805+
ratio = 0# '<== possibly used
806+
Resume
807+
End Function
808+
";
809+
var results = InspectionResultsForStandardModule(code);
810+
Assert.AreEqual(1, results.Count());
811+
}
812+
792813
protected override IInspection InspectionUnderTest(RubberduckParserState state)
793814
{
794815
return new AssignmentNotUsedInspection(state, new Walker());

0 commit comments

Comments
 (0)