Skip to content

Commit

Permalink
Clean up tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Vin committed Nov 8, 2023
1 parent 69c12b0 commit 363df2d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/syntax/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def test_point_in_region_2d():
ptA = new Point at [email protected]
ptB = new Point at [email protected]
ptC = new Point at (11, 4.5, 1)
param p = tuple([[email protected] in reg, 9@7 in reg, (11, 4.5, -1) in reg, ptA in reg, ptB in reg, ptC in reg])
param p = ([email protected] in reg, 9@7 in reg, (11, 4.5, -1) in reg, ptA in reg, ptB in reg, ptC in reg)
"""
)
assert p == (True, False, True, True, False, True)
Expand All @@ -469,7 +469,7 @@ def test_object_in_region_2d():
ego = new Object at [email protected], with width 0.25, with length 0.25
other_1 = new Object at [email protected], with width 2.5
other_2 = new Object at (11.5, 5.5, 2), with width 0.25, with length 0.25
param p = tuple([ego in reg, other_1 in reg, other_2 in reg])
param p = (ego in reg, other_1 in reg, other_2 in reg)
"""
)
assert p == (True, False, True)
Expand All @@ -482,7 +482,7 @@ def test_point_in_region_3d():
reg = BoxRegion()
ptA = new Point at (0.25,0.25,0.25)
ptB = new Point at (1,1,1)
param p = tuple([(0,0,0) in reg, (0.49,0.49,0.49) in reg, (0.5,0.5,0.5) in reg, (0.51,0.51,0.51) in reg, ptA in reg, ptB in reg])
param p = ((0,0,0) in reg, (0.49,0.49,0.49) in reg, (0.5,0.5,0.5) in reg, (0.51,0.51,0.51) in reg, ptA in reg, ptB in reg)
"""
)
assert p == (True, True, True, False, True, False)
Expand All @@ -497,7 +497,7 @@ def test_object_in_region_3d():
obj_2 = new Object at (0.49, 0.49, 0.49), with allowCollisions True
obj_3 = new Object at (0.75, 0.75, 0.75), with allowCollisions True
obj_4 = new Object at (3,3,3), with allowCollisions True
param p = tuple([obj_1 in reg, obj_2 in reg, obj_3 in reg, obj_4 in reg])
param p = (obj_1 in reg, obj_2 in reg, obj_3 in reg, obj_4 in reg)
"""
)
assert p == (True, True, False, False)
Expand All @@ -510,7 +510,7 @@ def test_intersects_obj_obj():
obj1 = new Object at (-1,0,0.1), with allowCollisions True
obj2 = new Object at (1,0,0), with allowCollisions True
obj3 = new Object with width 10, with length 10, with height 10, with allowCollisions True
param p = tuple([obj1 intersects obj2, obj1 intersects obj3, obj2 intersects obj3])
param p = (obj1 intersects obj2, obj1 intersects obj3, obj2 intersects obj3)
"""
)
assert p == (False, True, True)
Expand All @@ -521,10 +521,10 @@ def test_intersects_obj_obj():
"""
obj1 = new Object at (10,0,0), with width 30, with allowCollisions True
obj2 = new Object at (0,10,0), with length 30, with allowCollisions True
param p = tuple([obj1 intersects obj2,
param p = (obj1 intersects obj2,
obj1.position in obj2.occupiedSpace, obj2.position in obj1.occupiedSpace,
any((c in obj2.occupiedSpace) for c in obj1.corners),
any((c in obj1.occupiedSpace) for c in obj2.corners)])
any((c in obj1.occupiedSpace) for c in obj2.corners))
"""
)
assert p == (True, False, False, False, False)
Expand All @@ -536,7 +536,7 @@ def test_intersects_region_region():
reg1 = BoxRegion(position=(-1,0,0.1))
reg2 = BoxRegion(position=(1,0,0))
reg3 = BoxRegion(dimensions=(10,10,10))
param p = tuple([reg1 intersects reg2, reg1 intersects reg3, reg2 intersects reg3])
param p = (reg1 intersects reg2, reg1 intersects reg3, reg2 intersects reg3)
"""
)
assert p == (False, True, True)
Expand All @@ -548,8 +548,8 @@ def test_intersects_obj_region():
reg1 = BoxRegion(position=(-1,0,0.1))
obj2 = new Object at (1,0,0), with allowCollisions True
obj3 = new Object with width 10, with length 10, with height 10, with allowCollisions True
param p = tuple([reg1 intersects obj2, obj2 intersects reg1,
reg1 intersects obj3, obj3 intersects reg1])
param p = (reg1 intersects obj2, obj2 intersects reg1,
reg1 intersects obj3, obj3 intersects reg1)
"""
)
assert p == (False, False, True, True)
Expand All @@ -561,7 +561,7 @@ def test_intersects_2d():
obj1 = new Object at (0.2,0,0), with allowCollisions True
obj2 = new Object at (-0.2,0,0), with allowCollisions True
reg = RectangularRegion((0,0,0), 0, 10, 10)
param p = tuple([obj1 intersects obj2, obj1 intersects reg])
param p = (obj1 intersects obj2, obj1 intersects reg)
"""
)
assert p == (True, True)
Expand All @@ -573,7 +573,7 @@ def test_intersects_non_0_z():
obj1 = new Object at (0.2,0,1), with allowCollisions True
obj2 = new Object at (-0.2,0,1), with allowCollisions True
reg = RectangularRegion((0,0,1), 0, 10, 10)
param p = tuple([obj1 intersects obj2, obj1 intersects reg])
param p = (obj1 intersects obj2, obj1 intersects reg)
"""
)
assert p == (True, True)
Expand All @@ -596,7 +596,7 @@ def test_intersects_diff_z():
obj1 = new Object at (0,0,0.1), with allowCollisions True
obj2 = new Object at (0,0,10), with allowCollisions True
reg = RectangularRegion((0,0,0), 0, 10, 10)
param p = tuple([obj1 intersects reg, obj2 intersects reg, obj1 intersects obj2])
param p = (obj1 intersects reg, obj2 intersects reg, obj1 intersects obj2)
"""
)
assert p == (True, False, False)
Expand Down

0 comments on commit 363df2d

Please sign in to comment.