Skip to content

Commit 677f6da

Browse files
authored
Merge pull request #9732 from github/redsun82/swift-dot-syntax-call-expr
Swift: add DotSyntaxCallExpr tests
2 parents c4c3a52 + 364085a commit 677f6da

8 files changed

+38
-4
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| dot_syntax_call.swift:6:1:6:3 | call to foo(_:_:) | getFunction: | dot_syntax_call.swift:6:3:6:3 | foo(_:_:) | getBaseExpr: | dot_syntax_call.swift:6:1:6:1 | X.Type |
2+
| dot_syntax_call.swift:7:1:7:3 | call to bar() | getFunction: | dot_syntax_call.swift:7:3:7:3 | bar() | getBaseExpr: | dot_syntax_call.swift:7:1:7:1 | X.Type |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// generated by codegen/codegen.py
2+
import codeql.swift.elements
3+
import TestUtils
4+
5+
from DotSyntaxCallExpr x, Expr getFunction, Expr getBaseExpr
6+
where
7+
toBeTested(x) and
8+
not x.isUnknown() and
9+
getFunction = x.getFunction() and
10+
getBaseExpr = x.getBaseExpr()
11+
select x, "getFunction:", getFunction, "getBaseExpr:", getBaseExpr
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| dot_syntax_call.swift:6:1:6:3 | call to foo(_:_:) | 0 | : X.Type |
2+
| dot_syntax_call.swift:7:1:7:3 | call to bar() | 0 | : X.Type |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// generated by codegen/codegen.py
2+
import codeql.swift.elements
3+
import TestUtils
4+
5+
from DotSyntaxCallExpr x, int index
6+
where toBeTested(x) and not x.isUnknown()
7+
select x, index, x.getArgument(index)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| dot_syntax_call.swift:6:1:6:3 | call to foo(_:_:) | (Int, Int) -> () |
2+
| dot_syntax_call.swift:7:1:7:3 | call to bar() | () -> () |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// generated by codegen/codegen.py
2+
import codeql.swift.elements
3+
import TestUtils
4+
5+
from DotSyntaxCallExpr x
6+
where toBeTested(x) and not x.isUnknown()
7+
select x, x.getType()

swift/ql/test/extractor-tests/generated/expr/DotSyntaxCallExpr/MISSING_SOURCE.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class X {
2+
static func foo(_: Int, _:Int) {}
3+
class func bar() {}
4+
}
5+
6+
X.foo(1, 2)
7+
X.bar()

0 commit comments

Comments
 (0)