stdlib: protocol extensions: de-underscore startsWith()

Swift SVN r28233
This commit is contained in:
Dmitri Hrybenko
2015-05-07 00:30:21 +00:00
parent 62aa1f0e7c
commit e43ad56a1c
4 changed files with 15 additions and 47 deletions

View File

@@ -1788,11 +1788,11 @@ func checkHasPrefixHasSuffix(
map(rhs.decomposedStringWithCanonicalMapping) {
Array(String($0).unicodeScalars)
}
let expectHasPrefix =
startsWith(lhsNFDGraphemeClusters, rhsNFDGraphemeClusters, (==))
let expectHasSuffix = startsWith(
lazy(lhsNFDGraphemeClusters).reverse(),
lazy(rhsNFDGraphemeClusters).reverse(), (==))
let expectHasPrefix = lhsNFDGraphemeClusters.startsWith(
rhsNFDGraphemeClusters, isEquivalent: (==))
let expectHasSuffix =
lazy(lhsNFDGraphemeClusters).reverse().startsWith(
lazy(rhsNFDGraphemeClusters).reverse(), isEquivalent: (==))
expectEqual(expectHasPrefix, lhs.hasPrefix(rhs), stackTrace: stackTrace)
expectEqual(