Skip to content

Commit

Permalink
Merge pull request #274 from CodaFi/witnesses-cannot-into-themselves
Browse files Browse the repository at this point in the history
Provide actual Arbitrary conformances for Lazy*
  • Loading branch information
CodaFi authored Aug 26, 2018
2 parents a662cec + 73f5cf8 commit 2567216
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/SwiftCheck/WitnessedArbitrary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ extension Range : Arbitrary where Bound : Arbitrary {
public static var arbitrary : Gen<Range<Bound>> {
return Bound.arbitrary.flatMap { l in
return Bound.arbitrary.flatMap { r in
return Gen.pure((min(l, r) ..< max(l, r)))
return Gen.pure((Swift.min(l, r) ..< Swift.max(l, r)))
}
}
}
Expand All @@ -138,14 +138,14 @@ extension Range : Arbitrary where Bound : Arbitrary {
extension LazyCollection : Arbitrary where Base : Arbitrary {
/// Returns a generator of `LazyCollection`s of arbitrary `Base`s.
public static var arbitrary : Gen<LazyCollection<Base>> {
return LazyCollection<Base>.arbitrary
return Base.arbitrary.map({ $0.lazy })
}
}

extension LazySequence : Arbitrary where Base : Arbitrary {
/// Returns a generator of `LazySequence`s of arbitrary `Base`s.
public static var arbitrary : Gen<LazySequence<Base>> {
return LazySequence<Base>.arbitrary
return Base.arbitrary.map({ $0.lazy })
}
}

Expand Down

0 comments on commit 2567216

Please sign in to comment.