Skip to content

Commit

Permalink
Improved AdditionString test
Browse files Browse the repository at this point in the history
Prior test would have masked an incorrect result
  • Loading branch information
BZngr committed Sep 20, 2019
1 parent 11f458a commit 92c86ca
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2263,24 +2263,24 @@ End Select
[Category("Inspections")]
public void UnreachableCaseInspection_AdditionString()
{
//Resolving ""2"" + ""1"" to 21 (correct) yields 3 unreachable cases
//Resolving ""2"" + ""1"" to 3 (incorrect) would yield 1 unreachable case
string inputCode =
@"
private Const AVALUE As Double = 15
Sub FirstSub(bar As Double)
Sub FirstSub()
Dim bar As Double
bar = 22
Select Case bar
Case 4
Case 20 + 2
Case ""2"" + ""2""
Case ""2"" + ""1""
Case 21
'Unreachable
Case AVALUE + ""7""
Case 3 * 7
'Unreachable
Case (""1"" + ""0"") * 3 - 9
'Unreachable
Case 3
End Select
End Sub";
(string expectedMsg, string actualMsg) = CheckActualResultsEqualsExpected(inputCode, unreachable: 2);
(string expectedMsg, string actualMsg) = CheckActualResultsEqualsExpected(inputCode, unreachable: 3);
Assert.AreEqual(expectedMsg, actualMsg);
}

Expand Down

0 comments on commit 92c86ca

Please sign in to comment.