Files
codeql/csharp/ql/test/library-tests/statements/TryCatch3.ql
2018-08-02 17:53:23 +01:00

14 lines
406 B
Plaintext

/**
* @name Test for try catches
*/
import csharp
from Method m, TryStmt s
where s.getEnclosingCallable() = m
and m.getName() = "MainTryThrow"
and count((GeneralCatchClause)s.getACatchClause()) = 1
and count((SpecificCatchClause)s.getACatchClause()) = 1
and s.getCatchClause(0) instanceof SpecificCatchClause
and s.getCatchClause(1) instanceof GeneralCatchClause
select s, s.getACatchClause()