Skip to content

Commit e4da8da

Browse files
committed
Swift: Update the example code.
1 parent 098ea50 commit e4da8da

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

swift/ql/test/TestUtilities/InlineFlowTest.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
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
*

0 commit comments

Comments
 (0)