Skip to content

Commit

Permalink
Another to_float conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Apr 24, 2024
1 parent 8a15769 commit d88cfff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/Table_Tests/src/Database/Postgres_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,15 @@ postgres_specific_spec suite_builder create_connection_fn db_name setup =
t3 . at "X" . value_type . precision . should_equal Nothing
t3 . at "X" . value_type . scale . should_equal Nothing
# Works but only relying on imprecise float equality:
t3 . at "X" . to_vector . should_equal [super_large]
t3 . at "X" . to_vector . should_equal [super_large . to_float]
w3 = Problems.expect_only_warning Inexact_Type_Coercion t3
w3.requested_type . should_equal (Value_Type.Decimal precision=Nothing scale=0)
w3.actual_type . should_equal (Value_Type.Decimal precision=Nothing scale=Nothing)

m4 = t3.remove_warnings.read
# Because we no longer have a set scale, we cannot get a BigInteger column back - we'd need BigDecimal, but that is not fully supported yet in Enso - so we get the closest approximation - the imprecise Float.
m4 . at "X" . value_type . should_equal Value_Type.Float
m4 . at "X" . to_vector . should_equal [super_large]
m4 . at "X" . to_vector . should_equal [super_large . to_float]
w4 = Problems.expect_only_warning Inexact_Type_Coercion m4
w4.requested_type . should_equal (Value_Type.Decimal precision=Nothing scale=Nothing)
w4.actual_type . should_equal Value_Type.Float
Expand Down

0 comments on commit d88cfff

Please sign in to comment.