Skip to content

Commit

Permalink
add test cases for floats with exponents
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin committed Mar 2, 2025
1 parent 475dd3f commit 1c933db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_0eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ def test_float_coercion(self):
("1 <= 1.0", "true"),
("[1, 2.0]", "[1.000000, 2.000000]", WDL.Type.Array(WDL.Type.Float())),
("[1, 2.0][0]", "1.000000", WDL.Type.Float()),
("6.02e23", "601999999999999995805696.000000", WDL.Type.Float()),
# TODO: more sophisticated unification algo to handle this
# ("[[1],[2.0]]", "[[1.0], [2.0]]", WDL.Type.Array(WDL.Type.Float())),
)
Expand Down Expand Up @@ -517,6 +518,7 @@ def test_json(self):
(WDL.Type.Boolean(), False),
(WDL.Type.Int(), 42),
(WDL.Type.Float(), 3.14),
(WDL.Type.Float(), 6.02e23),
(WDL.Type.String(), 'CNN is working frantically to find their "source."'),
(WDL.Type.String(optional=True), None),
(WDL.Type.File(), '/tmp/stdout.txt'),
Expand Down

0 comments on commit 1c933db

Please # to comment.