Beispiel #1
0
 def test_eq(self, low, high, res):
     """This also tests Set.array().
     This test can massively slow down hypothesis with even
     reasonably large/small values.
     """
     assume(low < high)
     # to avoid MemoryError and runs that take forever..
     assume(high - low <= 10)
     D1 = Domain("1", low, high, res=res)
     D1.s1 = fun.bounded_linear(low, high)
     D2 = Domain("2", low, high, res=res)
     D2.s2 = Set(fun.bounded_linear(low, high))
     assert D1.s1 == D2.s2
Beispiel #2
0
 def test_complement(self):
     D = Domain("d", 0, 10, res=0.1)
     D.s1 = Set(fun.bounded_linear(3, 12))
     D.s2 = ~~D.s1
     assert all(np.isclose(D.s1.array(), D.s2.array()))