Skip to content

Commit e2b9b82

Browse files
committed
more tests
1 parent edee14f commit e2b9b82

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/compas/test_tolerance.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
from compas.tolerance import TOL
2+
from compas.geometry import Point
23

34

45
def test_tolerance_format_number():
56
assert TOL.format_number(0, precision=3) == "0.000"
67
assert TOL.format_number(0.5, precision=3) == "0.500"
8+
assert TOL.format_number(float(0), precision=3) == "0.000"
9+
10+
# Using default precision
11+
assert TOL.format_number(0) == "0.000"
12+
assert TOL.format_number(0.5) == "0.500"
13+
assert TOL.format_number(float(0)) == "0.000"
14+
15+
16+
def test_tolerance_format_point():
17+
point = Point(0, 0, 0)
18+
assert str(point) == "Point(x=0.000, y=0.000, z=0.000)"

0 commit comments

Comments
 (0)