Skip to content

Commit 6a8b9fd

Browse files
committed
Add data flowsources test
1 parent d6b14a1 commit 6a8b9fd

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

swift/ql/test/library-tests/dataflow/flowsources/FlowSources.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
| nsdata.swift:18:17:18:40 | call to init(contentsOf:) | external |
88
| nsdata.swift:19:17:19:17 | call to init(contentsOf:options:) | external |
99
| nsdata.swift:19:17:19:53 | call to init(contentsOf:options:) | external |
10+
| data.swift:18:20:18:20 | call to init(contentsOf:options:) | external |
11+
| data.swift:18:20:18:54 | call to init(contentsOf:options:) | external |
1012
| string.swift:56:21:56:21 | call to init(contentsOf:) | external |
1113
| string.swift:56:21:56:44 | call to init(contentsOf:) | external |
1214
| string.swift:57:21:57:21 | call to init(contentsOf:encoding:) | external |
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// --- stubs ---
2+
3+
struct URL
4+
{
5+
init?(string: String) {}
6+
}
7+
8+
9+
struct Data {
10+
struct ReadingOptions : OptionSet { let rawValue: Int }
11+
init(contentsOf: URL, options: ReadingOptions) {}
12+
}
13+
14+
// --- tests ---
15+
16+
func testData() {
17+
let url = URL(string: "http://example.com/")
18+
let data = try Data(contentsOf: url!, options: []) // SOURCE
19+
}

0 commit comments

Comments
 (0)