Skip to content

Commit 277a282

Browse files
committed
unified: Add qltest with string interpolation
1 parent 03eb996 commit 277a282

3 files changed

Lines changed: 22 additions & 5 deletions

File tree

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
let x = "hello"
1+
let x1 = "hello"
2+
let x2 = "hello \(123) world"
3+
let x3 = "hello \(arg: 123) world"
4+
let x4 = "hello \(1, 2, 3) world"

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
identifier
22
| name_expr.swift:1:5:1:5 | x | x |
33
| name_expr.swift:1:9:1:9 | y | y |
4-
| strings.swift:1:5:1:5 | x | x |
4+
| strings.swift:1:5:1:6 | x1 | x1 |
5+
| strings.swift:2:5:2:6 | x2 | x2 |
6+
| strings.swift:3:5:3:6 | x3 | x3 |
7+
| strings.swift:3:19:3:21 | arg | arg |
8+
| strings.swift:4:5:4:6 | x4 | x4 |
59
| test.swift:1:8:1:17 | Foundation | Foundation |
610
| test.swift:1:8:1:17 | Foundation | Foundation |
711
| test.swift:4:8:4:16 | Container | Container |
@@ -151,5 +155,13 @@ identifier
151155
namedPattern
152156
| test.swift:1:1:1:17 | NamedPattern | Foundation |
153157
unsupported
154-
stringValue
155-
| strings.swift:1:9:1:15 | "hello" | "hello" |
158+
rawStringValue
159+
| strings.swift:1:10:1:16 | "hello" | "hello" |
160+
| strings.swift:2:11:2:16 | hello | hello |
161+
| strings.swift:2:23:2:28 | world | world |
162+
| strings.swift:3:11:3:16 | hello | hello |
163+
| strings.swift:3:28:3:33 | world | world |
164+
| strings.swift:4:11:4:16 | hello | hello |
165+
| strings.swift:4:27:4:32 | world | world |
166+
exprStringValue
167+
| strings.swift:1:10:1:16 | "hello" | hello |

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ query predicate namedPattern(NamedPattern node, string value) { value = node.get
66

77
query predicate unsupported(UnsupportedNode node, string value) { value = node.getValue() }
88

9-
query predicate stringValue(StringLiteral e, string value) { value = e.getValue() }
9+
query predicate rawStringValue(StringLiteral e, string value) { value = e.getValue() }
10+
11+
query predicate exprStringValue(Expr e, string value) { value = e.getStringValue() }

0 commit comments

Comments
 (0)