C#: Add a testcase with an empty if statement containing a comment.

This commit is contained in:
Michael Nebel
2025-03-05 15:22:22 +01:00
parent a9d45a2aa2
commit 361bdfac12
2 changed files with 9 additions and 0 deletions

View File

@@ -25,5 +25,10 @@ class FutileConditionalTest
else
{
} // $ Alert
if (s.Length > 4)
{
// GOOD: Because of the comment.
}
}
}

View File

@@ -1,3 +1,7 @@
#select
| FutileConditional.cs:8:9:8:27 | if (...) ... | If-statement with an empty then-branch and no else-branch. |
| FutileConditional.cs:10:9:12:9 | if (...) ... | If-statement with an empty then-branch and no else-branch. |
| FutileConditional.cs:22:9:27:9 | if (...) ... | If-statement with an empty then-branch and no else-branch. |
| FutileConditional.cs:29:9:32:9 | if (...) ... | If-statement with an empty then-branch and no else-branch. |
testFailures
| FutileConditional.cs:29:9:32:9 | If-statement with an empty then-branch and no else-branch. | Unexpected result: Alert |