diff --git a/analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/RoslynSymbolicExecutionTest.Branching.cs b/analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/RoslynSymbolicExecutionTest.Branching.cs index 76517404bd4..57c151ebdbd 100644 --- a/analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/RoslynSymbolicExecutionTest.Branching.cs +++ b/analyzers/tests/SonarAnalyzer.UnitTest/SymbolicExecution/Roslyn/RoslynSymbolicExecutionTest.Branching.cs @@ -393,6 +393,26 @@ public void Branching_NoConstraint_VisitsBothBranches() "End"); } + [TestMethod] + public void Branching_OtherConstraint_VisitsBothBranches() + { + const string code = @" +if (boolParameter) +{ + Tag(""If""); +} +else +{ + Tag(""Else""); +} +Tag(""End"");"; + var check = new PostProcessTestCheck(x => x.Operation.Instance.TrackedSymbol() is { } symbol ? x.SetSymbolConstraint(symbol, DummyConstraint.Dummy) : x.State); + SETestContext.CreateCS(code, check).Validator.ValidateTagOrder( + "If", + "Else", + "End"); + } + [TestMethod] public void Branching_BoolConstraints_ComplexCase() {