Files
swift-mirror/test/stdlib/LazySlice.swift
Saleem Abdulrasool b67d5f0cf7 test: convert rm -rf && mkdir -p into %empty-directory
This converts the instances of the pattern for which we have a proper
substitution in lit.  This will make it easier to replace it
appropriately with Windows equivalents.
2018-03-06 14:30:54 -08:00

19 lines
574 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -o %t/a.out3 -swift-version 3 && %target-run %t/a.out3
// REQUIRES: executable_test
import StdlibUnittest
var tests = TestSuite("LazySlice")
tests.test("CommuteLazyness") {
let a = [1,2,3].lazy
let b = a[...]
var c = b.filter { $0 == 0 }
// NOTE, this test will fail once lazy collectionness becomes a conditiona
// conformance, and will need updating to be a LazyBidirectional thingy
expectType(LazyFilterBidirectionalCollection<Slice<LazyRandomAccessCollection<[Int]>>>.self, &c)
}
runAllTests()