예제 #1
0
    def test_std_range(self, x, y):
        o, p = x[0], x[1]
        y_0 = y[0]
        y_1 = y[1]

        z = rng(o, p)
        z_0 = z[0]
        z_1 = z[1]

        self.assertEqual(y_0, z_0)
        self.assertEqual((y_1.a, y_1.b), (z_1.a, z_1.b))
예제 #2
0
 def choose(cls, l, h):
     return Gen.map(
         Gen.rand(),
         lambda stdgen: rng((l, h), stdgen)[0]
     )
예제 #3
0
 def eval(cls, n, rnd, gn):
     size, rnd_1 = rng((0, n), rnd)
     return gn.gen(size, rnd_1)