Skip to content

Commit

Permalink
default precision problem?
Browse files Browse the repository at this point in the history
  • Loading branch information
yck011522 committed Jul 10, 2024
1 parent e2b9b82 commit 4db4c12
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/compas/test_tolerance.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
from compas.tolerance import TOL
from compas.tolerance import Tolerance
from compas.geometry import Point


def test_tolerance_default_tolerance():
TOL.precision == Tolerance.PRECISION


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

def test_tolerance_format_number_with_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"
Expand Down

0 comments on commit 4db4c12

Please sign in to comment.