mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
C#: Add a testcase with an empty if statement containing a comment.
This commit is contained in:
@@ -25,5 +25,10 @@ class FutileConditionalTest
|
||||
else
|
||||
{
|
||||
} // $ Alert
|
||||
|
||||
if (s.Length > 4)
|
||||
{
|
||||
// GOOD: Because of the comment.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 |
|
||||
|
||||
Reference in New Issue
Block a user