Skip to content

Commit

Permalink
Merge pull request #254 from CodaFi/ninety-one
Browse files Browse the repository at this point in the history
Update for Xcode 9.1
  • Loading branch information
CodaFi authored Nov 2, 2017
2 parents 6044150 + 816076e commit df82fb8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "trill-lang/FileCheck" "0.0.3"
github "trill-lang/FileCheck" "0.0.4"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/FileCheck
2 changes: 1 addition & 1 deletion Sources/SwiftCheck/Arbitrary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ extension String : Arbitrary {

/// The default shrinking function for `String` values.
public static func shrink(_ s : String) -> [String] {
return [Character].shrink([Character](s.characters)).map { String($0) }
return [Character].shrink(s.map{$0}).map { String($0) }
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftCheck/CoArbitrary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extension String : CoArbitrary {
}
return comp(
Character.coarbitrary(x[x.startIndex]),
String.coarbitrary(String(x[x.characters.index(after: x.startIndex)..<x.endIndex]))
String.coarbitrary(String(x[x.index(after: x.startIndex)..<x.endIndex]))
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftCheck/Property.swift
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ private func printLabels(_ st : TestResult) {
let gAllLabels = st.labels.map({ t in
return t.0 + ", "
}).reduce("", +)
print("(" + gAllLabels[gAllLabels.startIndex..<gAllLabels.characters.index(gAllLabels.endIndex, offsetBy: -2)] + ")")
print("(" + gAllLabels[gAllLabels.startIndex..<gAllLabels.index(gAllLabels.endIndex, offsetBy: -2)] + ")")
}
}

Expand Down
6 changes: 3 additions & 3 deletions Tests/SwiftCheckTests/ComplexSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ComplexSpec : XCTestCase {
/// CHECKEMAIL: *** Passed 1 test
/// CHECKEMAIL-NEXT: .
property("Generated email addresses contain 1 @", arguments: args) <- forAll(emailGen) { (e : String) in
return e.filter({ $0 == "@" }).characters.count == 1
return (e.filter({ $0 == "@" }) as [Character]).count == 1
}.once
})
}
Expand All @@ -70,7 +70,7 @@ class ComplexSpec : XCTestCase {
/// CHECKIPV6: *** Passed 100 tests
/// CHECKIPV6-NEXT: .
property("Generated IPs contain 3 sections") <- forAll(ipGen) { (e : String) in
return e.filter({ $0 == ":" }).characters.count == 3
return (e.filter({ $0 == ":" }) as [Character]).count == 3
}
})
}
Expand All @@ -91,6 +91,6 @@ func glue(_ parts : [Gen<String>]) -> Gen<String> {

extension String {
fileprivate var initial : String {
return String(self[self.startIndex..<self.characters.index(before: self.endIndex)])
return String(self[self.startIndex..<self.index(before: self.endIndex)])
}
}

0 comments on commit df82fb8

Please sign in to comment.