Skip to content

Commit e9c4cb2

Browse files
committed
Swift: add more diagnostics tests
1 parent 680b7a1 commit e9c4cb2

File tree

6 files changed

+10
-1
lines changed

6 files changed

+10
-1
lines changed

swift/ql/test/extractor-tests/Diagnostics/Diagnostics.expected

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
| diags.swift:1:10:1:10 | Diagnostics | getText: | Hello, warning | getKind: | 2 |
2+
| error.swift:2:14:2:14 | Diagnostics | getText: | cannot convert value of type 'String' to specified type 'Int' | getKind: | 1 |
3+
| import-error.swift:2:8:2:8 | Diagnostics | getText: | no such module 'FooBar' | getKind: | 1 |
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
// generated by codegen/codegen.py
12
import codeql.swift.elements
23
import TestUtils
34

45
from Diagnostics x, string getText, int getKind
56
where
7+
toBeTested(x) and
8+
not x.isUnknown() and
69
getText = x.getText() and
710
getKind = x.getKind()
811
select x, "getText:", getText, "getKind:", getKind
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//codeql-extractor-expected-status: 1
2+
let x: Int = "Hello"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//codeql-extractor-expected-status: 1
2+
import FooBar

0 commit comments

Comments
 (0)