1
import Bow
2
import SwiftCheck
3

4
// MARK: Generator for Property-based Testing
5

6
extension Store: Arbitrary where S: CoArbitrary & Hashable & Arbitrary, V: Arbitrary {
7 0
    public static var arbitrary: Gen<Store<S, V>> {
8 0
        return Gen.from(StorePartial.generate >>> Store.fix)
9
    }
10
}
11

12
// MARK: Instance of `ArbitraryK` for `Store`
13

14
extension StorePartial: ArbitraryK where S: CoArbitrary & Hashable & Arbitrary {
15 1
    public static func generate<A: Arbitrary>() -> Kind<StorePartial<S>, A> {
16 1
        return Store(state: S.arbitrary.generate, render: ArrowOf<S, A>.arbitrary.generate.getArrow)
17
    }
18
}

Read our documentation on viewing source code .

Loading