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 1616 * To declare expectations, you can use the $hasTaintFlow or $hasValueFlow comments within the test source files.
1717 * Example of the corresponding test file, e.g. Test.java
1818 * ```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 }
2121 * func sink(_ o: Any) { }
2222 *
2323 * 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
2828 * }
2929 * ```
3030 *
You can’t perform that action at this time.
0 commit comments