Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yck011522 committed Jul 10, 2024
1 parent edee14f commit e2b9b82
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/compas/test_tolerance.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
from compas.tolerance import TOL
from compas.geometry import Point


def test_tolerance_format_number():
assert TOL.format_number(0, precision=3) == "0.000"
assert TOL.format_number(0.5, precision=3) == "0.500"
assert TOL.format_number(float(0), precision=3) == "0.000"

# Using default precision
assert TOL.format_number(0) == "0.000"
assert TOL.format_number(0.5) == "0.500"
assert TOL.format_number(float(0)) == "0.000"


def test_tolerance_format_point():
point = Point(0, 0, 0)
assert str(point) == "Point(x=0.000, y=0.000, z=0.000)"

0 comments on commit e2b9b82

Please sign in to comment.