Skip to content

Commit ef9376d

Browse files
committed
Swift: more ArrayContent tests
1 parent 42cc644 commit ef9376d

File tree

1 file changed

+12
-0
lines changed
  • swift/ql/test/library-tests/dataflow/dataflow

1 file changed

+12
-0
lines changed

swift/ql/test/library-tests/dataflow/dataflow/test.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,4 +645,16 @@ func testArray() {
645645
var matrix = [[source()]]
646646
sink(arg: matrix[0])
647647
sink(arg: matrix[0][0]) // $ flow=645
648+
649+
var arr3 = [1]
650+
var arr4 = arr2 + arr3
651+
sink(arg: arr3)
652+
sink(arg: arr4) // $ flow=642
653+
654+
var arr5 = Array(repeating: source(), count: 2)
655+
sink(arg: arr5) // $ flow=654
656+
657+
var arr6 = [1,2,3]
658+
arr6.insert(source(), at: 2)
659+
sink(arg: arr6)
648660
}

0 commit comments

Comments
 (0)