File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
swift/ql/test/TestUtilities Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 16
16
* To declare expectations, you can use the $hasTaintFlow or $hasValueFlow comments within the test source files.
17
17
* Example of the corresponding test file, e.g. Test.java
18
18
* ```swift
19
- * func source() -> Any { return nil }
20
- * func taint() -> Any { return nil }
19
+ * func source(_ label: String ) -> Any { return nil }
20
+ * func taint(_ label: String ) -> Any { return nil }
21
21
* func sink(_ o: Any) { }
22
22
*
23
23
* func test() {
24
- * let s = source()
25
- * sink(s) // $ hasValueFlow
26
- * let t = "foo" + taint()
27
- * sink(t); // $ hasTaintFlow
24
+ * let s = source("mySource" )
25
+ * sink(s) // $ hasValueFlow=mySource
26
+ * let t = "foo" + taint("myTaint" )
27
+ * sink(t); // $ hasTaintFlow=myTaint
28
28
* }
29
29
* ```
30
30
*
You can’t perform that action at this time.
0 commit comments