Skip to content

Commit

Permalink
Fixed range_query_test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AlfredChester committed Dec 15, 2024
1 parent 29f0034 commit d89d6e7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cyaron/tests/range_query_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TestRangeQuery(unittest.TestCase):

def test_allow_equal_v1(self):
dimension = random.randint(1, 10)
limits = Vector.random(dimension, [1000]) # n1, n2 ...
limits = Vector.random(dimension, [(1, 1000)]) # n1, n2 ...
Q = RangeQuery.random(10**5, limits)
self.assertEqual(len(Q), 10**5)
for i in range(10**5):
Expand All @@ -37,7 +37,7 @@ def test_allow_equal_v1(self):

def test_allow_equal_v2_throw(self):
dimension = random.randint(1, 10)
limits = Vector.random(dimension, [1000, 1000]) # n1, n2 ...
limits = Vector.random(dimension, [(1, 1000), (1, 1000)]) # n1, n2 ...
conflict = False
for i in range(dimension):
conflict = conflict or limits[i][0] > limits[i][1]
Expand All @@ -56,7 +56,7 @@ def test_allow_equal_v2_throw(self):

def test_allow_equal_v2_no_throw(self):
dimension = random.randint(1, 10)
limits = Vector.random(dimension, [1000, 1000]) # n1, n2 ...
limits = Vector.random(dimension, [(1, 1000), (1, 1000)]) # n1, n2 ...
for i in range(dimension):
if limits[i][0] > limits[i][1]:
limits[i][0], limits[i][1] = limits[i][1], limits[i][0]
Expand All @@ -69,7 +69,7 @@ def test_allow_equal_v2_no_throw(self):

def test_less_v1(self):
dimension = random.randint(1, 10)
limits = Vector.random(dimension, [1000]) # n1, n2 ...
limits = Vector.random(dimension, [(1, 1000)]) # n1, n2 ...
Q = RangeQuery.random(10**5, limits, RangeQueryRandomMode.less)
self.assertEqual(len(Q), 10**5)
for i in range(10**5):
Expand All @@ -79,7 +79,7 @@ def test_less_v1(self):

def test_less_v2_throw(self):
dimension = random.randint(1, 10)
limits = Vector.random(dimension, [1000, 1000]) # n1, n2 ...
limits = Vector.random(dimension, [(1, 1000), (1, 1000)]) # n1, n2 ...
conflict = False
for i in range(dimension):
conflict = conflict or limits[i][0] >= limits[i][1]
Expand All @@ -98,7 +98,7 @@ def test_less_v2_throw(self):

def test_less_v2_no_throw(self):
dimension = random.randint(1, 10)
limits = Vector.random(dimension, [1000, 1000]) # n1, n2 ...
limits = Vector.random(dimension, [(1, 1000), (1, 1000)]) # n1, n2 ...
for i in range(dimension):
while limits[i][0] == limits[i][1]:
limits[i][0] = random.randint(1, 1000)
Expand Down

0 comments on commit d89d6e7

Please sign in to comment.