Slide 20
Slide 20 text
Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
Array#reversed
func testReversed() {
let empty = Array()
XCTAssertEqual(empty.reversed(), empty)
XCTAssertEqual( [1].reversed(), [1])
XCTAssertEqual( [1, 2].reversed(), [2, 1])
XCTAssertEqual([1, 2, 3, 4, 5].reversed(), [5, 4, 3, 2, 1])
...
}
There are infinite possible input values!