Skip to content

Commit

Permalink
Split the test into individual tests for each operations
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Sep 10, 2024
1 parent 8b284c2 commit 70634d2
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions test/Base_Tests/src/Data/Decimal_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,20 @@ add_specs suite_builder =
(lesser > d) . should_be_false
(lesser >= d) . should_be_false

group_builder.specify "mixed float/decimal comparisons should attach a warning" pending="https://github.com/enso-org/enso/issues/10679" <|
[(_ == _), (_ != _), (_ <= _), (_ >= _), (_ < _), (_ > _), .min, .max].map c->
a = c (Decimal.new "0.1") 0.1
b = c 0.1 (Decimal.new "0.1")
compare_operations = Vector.build b->
b.append ["==", (_ == _)]
b.append ["!=", (_ != _)]
b.append ["<=", (_ <= _)]
b.append [">=", (_ >= _)]
b.append ["<", (_ < _)]
b.append [">", (_ > _)]
b.append ["min", .min]
b.append ["max", .max]

compare_operations.map p->
group_builder.specify p.first+" mixed float/decimal comparisons should attach a warning" <|
a = p.second (Decimal.new "0.1") 0.1
b = p.second 0.1 (Decimal.new "0.1")
Problems.expect_only_warning (Loss_Of_Numeric_Precision.Warning 0.1 (Decimal.new "0.1")) a
Problems.expect_only_warning (Loss_Of_Numeric_Precision.Warning 0.1 (Decimal.new "0.1")) b

Expand Down

0 comments on commit 70634d2

Please sign in to comment.