Skip to content

Commit 91a151e

Browse files
committed
Swift: update tests
1 parent 3d67970 commit 91a151e

File tree

73 files changed

+470
-466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+470
-466
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import swift
22

3-
from DestructorDecl d
3+
from Deinitializer d
44
where d.getLocation().getFile().getBaseName() != "Package.swift"
55
select d
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import swift
1+
import codeql.swift.elements.decl.AccessorOrNamedFunction
22

3-
from FuncDecl f
3+
from AccessorOrNamedFunction f
44
where f.getLocation().getFile().getBaseName() != "Package.swift"
55
select f
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import swift
22

3-
from ConstructorDecl d
3+
from Initializer d
44
where d.getLocation().getFile().getBaseName() != "Package.swift"
55
select d

swift/integration-tests/posix-only/deduplication/Decls.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
| Sources/deduplication/def.swift:1:1:1:9 | var ... = ... | PatternBindingDecl |
22
| Sources/deduplication/def.swift:1:5:1:5 | x | ConcreteVarDecl |
33
| Sources/deduplication/def.swift:3:1:3:20 | Generic | StructDecl |
4-
| Sources/deduplication/def.swift:3:8:3:8 | Generic<T>.init() | ConstructorDecl |
4+
| Sources/deduplication/def.swift:3:8:3:8 | Generic<T>.init() | Initializer |
55
| Sources/deduplication/def.swift:3:8:3:8 | self | ParamDecl |
66
| Sources/deduplication/def.swift:3:16:3:16 | T | GenericTypeParamDecl |
77
| Sources/deduplication/def.swift:5:1:5:41 | var ... = ... | PatternBindingDecl |
88
| Sources/deduplication/def.swift:5:5:5:5 | instantiated_generic | ConcreteVarDecl |
9-
| Sources/deduplication/def.swift:7:1:7:42 | function(_:) | ConcreteFuncDecl |
9+
| Sources/deduplication/def.swift:7:1:7:42 | function(_:) | NamedFunction |
1010
| Sources/deduplication/def.swift:7:15:7:18 | _ | ParamDecl |
1111
| Sources/deduplication/use.swift:1:1:1:13 | var ... = ... | PatternBindingDecl |
1212
| Sources/deduplication/use.swift:1:5:1:5 | use_x | ConcreteVarDecl |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import swift
22

3-
from StructDecl struct, ConstructorDecl decl, BraceStmt body
3+
from StructDecl struct, Initializer decl, BraceStmt body
44
where struct.getName() = "hello_world" and decl = struct.getAMember() and body = decl.getBody()
55
select decl, body
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import swift
22

3-
from ConcreteFuncDecl decl, BraceStmt body
3+
from NamedFunction decl, BraceStmt body
44
where decl.getName() = "foo()" and decl.getBody() = body
55
select decl, body

swift/ql/test/TestUtils.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
private import codeql.swift.elements
22
private import codeql.swift.generated.ParentChild
33

4+
// Internal classes are not imported by the tests:
5+
import codeql.swift.elements.expr.InitializerRefCallExpr
6+
import codeql.swift.elements.expr.DotSyntaxCallExpr
7+
48
cached
59
predicate toBeTested(Element e) {
610
e instanceof File

swift/ql/test/extractor-tests/expressions/all.expected

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
| expressions.swift:38:14:38:14 | 7 | IntegerLiteralExpr |
8787
| expressions.swift:41:1:41:1 | closured(closure:) | DeclRefExpr |
8888
| expressions.swift:41:1:43:1 | call to closured(closure:) | CallExpr |
89-
| expressions.swift:41:10:43:1 | { ... } | ClosureExpr |
89+
| expressions.swift:41:10:43:1 | { ... } | ExplicitClosureExpr |
9090
| expressions.swift:42:12:42:12 | x | DeclRefExpr |
9191
| expressions.swift:42:12:42:16 | ... .+(_:_:) ... | BinaryExpr |
9292
| expressions.swift:42:14:42:14 | +(_:_:) | DeclRefExpr |
@@ -95,7 +95,7 @@
9595
| expressions.swift:42:16:42:16 | y | DeclRefExpr |
9696
| expressions.swift:44:1:44:1 | closured(closure:) | DeclRefExpr |
9797
| expressions.swift:44:1:46:1 | call to closured(closure:) | CallExpr |
98-
| expressions.swift:44:10:46:1 | { ... } | ClosureExpr |
98+
| expressions.swift:44:10:46:1 | { ... } | ExplicitClosureExpr |
9999
| expressions.swift:45:12:45:12 | x | DeclRefExpr |
100100
| expressions.swift:45:12:45:16 | ... .+(_:_:) ... | BinaryExpr |
101101
| expressions.swift:45:14:45:14 | +(_:_:) | DeclRefExpr |
@@ -104,7 +104,7 @@
104104
| expressions.swift:45:16:45:16 | y | DeclRefExpr |
105105
| expressions.swift:47:1:47:1 | closured(closure:) | DeclRefExpr |
106106
| expressions.swift:47:1:47:27 | call to closured(closure:) | CallExpr |
107-
| expressions.swift:47:10:47:27 | { ... } | ClosureExpr |
107+
| expressions.swift:47:10:47:27 | { ... } | ExplicitClosureExpr |
108108
| expressions.swift:47:19:47:19 | $0 | DeclRefExpr |
109109
| expressions.swift:47:19:47:24 | ... .+(_:_:) ... | BinaryExpr |
110110
| expressions.swift:47:22:47:22 | +(_:_:) | DeclRefExpr |
@@ -113,7 +113,7 @@
113113
| expressions.swift:47:24:47:24 | $1 | DeclRefExpr |
114114
| expressions.swift:48:1:48:1 | closured(closure:) | DeclRefExpr |
115115
| expressions.swift:48:1:48:20 | call to closured(closure:) | CallExpr |
116-
| expressions.swift:48:10:48:20 | { ... } | ClosureExpr |
116+
| expressions.swift:48:10:48:20 | { ... } | ExplicitClosureExpr |
117117
| expressions.swift:48:12:48:12 | $0 | DeclRefExpr |
118118
| expressions.swift:48:12:48:17 | ... .+(_:_:) ... | BinaryExpr |
119119
| expressions.swift:48:15:48:15 | +(_:_:) | DeclRefExpr |
@@ -134,7 +134,7 @@
134134
| expressions.swift:60:23:60:23 | (Int) ... | LoadExpr |
135135
| expressions.swift:60:23:60:23 | myNumber | DeclRefExpr |
136136
| expressions.swift:60:33:60:63 | ((UnsafePointer<Int>) throws -> ()) ... | FunctionConversionExpr |
137-
| expressions.swift:60:33:60:63 | { ... } | ClosureExpr |
137+
| expressions.swift:60:33:60:63 | { ... } | ExplicitClosureExpr |
138138
| expressions.swift:60:35:60:35 | unsafeFunction(pointer:) | DeclRefExpr |
139139
| expressions.swift:60:35:60:61 | call to unsafeFunction(pointer:) | CallExpr |
140140
| expressions.swift:60:59:60:59 | $0 | DeclRefExpr |
@@ -158,8 +158,8 @@
158158
| expressions.swift:79:5:79:5 | super | SuperRefExpr |
159159
| expressions.swift:79:5:79:11 | Base.init(x:) | MethodLookupExpr |
160160
| expressions.swift:79:5:79:21 | call to Base.init(x:) | CallExpr |
161-
| expressions.swift:79:5:79:21 | self = ... | RebindSelfInConstructorExpr |
162-
| expressions.swift:79:11:79:11 | Base.init(x:) | OtherConstructorDeclRefExpr |
161+
| expressions.swift:79:5:79:21 | self = ... | RebindSelfInInitializerExpr |
162+
| expressions.swift:79:11:79:11 | Base.init(x:) | OtherInitializerRefExpr |
163163
| expressions.swift:79:19:79:19 | 22 | IntegerLiteralExpr |
164164
| expressions.swift:83:15:83:15 | Derived.Type | TypeExpr |
165165
| expressions.swift:83:15:83:15 | Derived.init() | DeclRefExpr |

0 commit comments

Comments
 (0)