mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Swift: Add test and accept output
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
| types.swift:24:1:26:1 | throwingFunc | () throws -> Int | throws |
|
||||
| types.swift:28:1:28:36 | asyncFunction | (Int) async -> () | async |
|
||||
| types.swift:30:1:30:54 | throwingAndAsyncFunction | (Int) async throws -> () | async |
|
||||
| types.swift:30:1:30:54 | throwingAndAsyncFunction | (Int) async throws -> () | throws |
|
||||
12
swift/ql/test/extractor-tests/types/ThrowingAndAsync.ql
Normal file
12
swift/ql/test/extractor-tests/types/ThrowingAndAsync.ql
Normal file
@@ -0,0 +1,12 @@
|
||||
import codeql.swift.elements
|
||||
|
||||
from FuncDecl f, AnyFunctionType t, string s
|
||||
where
|
||||
f.getInterfaceType() = t and
|
||||
f.getLocation().getFile().getName().matches("%swift/ql/test%") and
|
||||
(
|
||||
t.isAsync() and s = "async"
|
||||
or
|
||||
t.isThrowing() and s = "throws"
|
||||
)
|
||||
select f, t, s
|
||||
Reference in New Issue
Block a user