Files
swift-mirror/validation-test/stdlib/Stride.swift
Joe Groff b8528812e4 Remove unnecessary type annotations.
Scoring collection conversions should hopefully make these coercions unnecessary now.
2016-07-27 14:31:52 -07:00

20 lines
522 B
Swift

// RUN: %target-run-simple-swift
// REQUIRES: executable_test
import StdlibUnittest
import StdlibCollectionUnittest
var StrideTestSuite = TestSuite("Stride")
StrideTestSuite.test("to") {
checkSequence(Array(0...4), stride(from: 0, to: 5, by: 1))
checkSequence(Array(1...5).reversed(), stride(from: 5, to: 0, by: -1))
}
StrideTestSuite.test("through") {
checkSequence(Array(0...5), stride(from: 0, through: 5, by: 1))
checkSequence(Array(0...5).reversed(), stride(from: 5, through: 0, by: -1))
}
runAllTests()