Пример #1
0
    def test_fuzz(self):
        for _ in range(1):
            len_x, len_y = random.randint(5, 50), random.randint(5, 50)
            xs = tuple(random.uniform(-100, 100) for _ in range(len_x))
            ys = tuple(random.uniform(-100, 100) for _ in range(len_y))

            slow = slow_a12(xs, ys)
            fast = rdiv.a12(xs, ys)
            if slow != fast:
                print('xs =', xs)
                print('ys =', ys)
                assert_equal(slow, fast)
Пример #2
0
    def test_fuzz(self):
        for _ in range(1):
            len_x, len_y = random.randint(5, 50), random.randint(5, 50)
            xs = tuple(random.uniform(-100, 100) for _ in range(len_x))
            ys = tuple(random.uniform(-100, 100) for _ in range(len_y))

            slow = slow_a12(xs, ys)
            fast = rdiv.a12(xs, ys)
            if slow != fast:
                print("xs =", xs)
                print("ys =", ys)
                assert_equal(slow, fast)
Пример #3
0
    def test_small(self):
        xs = [2, 2, 2, 2, 10]
        ys = [5, 5, 5, 5, 5]

        assert_equal(rdiv.a12(xs, ys), 5 / 25)
Пример #4
0
    def test_small(self):
        xs = [2, 2, 2, 2, 10]
        ys = [5, 5, 5, 5, 5]

        assert_equal(rdiv.a12(xs, ys), 5 / 25)