Skip to content

Commit 0e5d15d

Browse files
committed
unified: Add a some tuples to BasicTest
1 parent b0087fc commit 0e5d15d

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

unified/ql/test/library-tests/BasicTest/test.expected

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ identifier
153153
| test.swift:87:31:87:36 | reduce | reduce |
154154
| test.swift:87:38:87:43 | values | values |
155155
| test.swift:87:49:87:57 | transform | transform |
156+
| test.swift:90:5:90:9 | tuple | tuple |
157+
| test.swift:91:5:91:10 | unary1 | unary1 |
158+
| test.swift:92:5:92:10 | unary2 | unary2 |
156159
namedPattern
157160
| test.swift:1:1:1:17 | NamedPattern | Foundation |
158161
unsupported
@@ -164,6 +167,9 @@ rawStringValue
164167
| strings.swift:3:28:3:33 | world | world |
165168
| strings.swift:4:11:4:16 | hello | hello |
166169
| strings.swift:4:27:4:32 | world | world |
170+
| test.swift:90:17:90:23 | "hello" | "hello" |
171+
| test.swift:91:15:91:29 | "parenthesized" | "parenthesized" |
172+
| test.swift:92:16:92:37 | "double-parenthesized" | "double-parenthesized" |
167173
exprStringValue
168174
| strings.swift:1:10:1:16 | "hello" | hello |
169175
| strings.swift:2:11:2:16 | hello | hello |
@@ -172,3 +178,7 @@ exprStringValue
172178
| strings.swift:3:28:3:33 | world | world |
173179
| strings.swift:4:11:4:16 | hello | hello |
174180
| strings.swift:4:27:4:32 | world | world |
181+
| test.swift:90:17:90:23 | "hello" | hello |
182+
| test.swift:91:15:91:29 | "parenthesized" | parenthesized |
183+
| test.swift:92:16:92:37 | "double-parenthesized" | double-parenthesized |
184+
unexpectedUnaryTuple

unified/ql/test/library-tests/BasicTest/test.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ query predicate unsupported(UnsupportedNode node, string value) { value = node.g
99
query predicate rawStringValue(StringLiteral e, string value) { value = e.getValue() }
1010

1111
query predicate exprStringValue(Expr e, string value) { value = e.getStringValue() }
12+
13+
query predicate unexpectedUnaryTuple(TupleExpr tuple) { count(tuple.getAnElement()) = 1 }

unified/ql/test/library-tests/BasicTest/test.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,7 @@ func combine<T>(_ values: [T], transform: (T, T) -> T) -> T? {
8686
guard !values.isEmpty else { return nil }
8787
return values.dropFirst().reduce(values[0], transform)
8888
}
89+
90+
let tuple = (1, "hello", true)
91+
let unary1 = ("parenthesized")
92+
let unary2 = (("double-parenthesized"))

0 commit comments

Comments
 (0)