From 16736feb13eec87eb9ca114deaeb4f7eeb7409d2 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Fri, 11 Oct 2024 05:19:58 -0300 Subject: Fix hashing of equal decimals with different scales (#5179) Co-authored-by: Laurenz --- tests/suite/foundations/decimal.typ | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/suite/foundations/decimal.typ b/tests/suite/foundations/decimal.typ index d5fd9444..bae0d2e6 100644 --- a/tests/suite/foundations/decimal.typ +++ b/tests/suite/foundations/decimal.typ @@ -31,6 +31,13 @@ // Error: 10-19 float is not a valid decimal: float.nan #decimal(float.nan) +--- decimal-scale-is-observable --- +// Ensure equal decimals with different scales produce different strings. +#let f1(x) = str(x) +#let f2(x) = f1(x) +#test(f2(decimal("3.140")), "3.140") +#test(f2(decimal("3.14000")), "3.14000") + --- decimal-repr --- // Test the `repr` function with decimals. #test(repr(decimal("12.0")), "decimal(\"12.0\")") -- cgit v1.2.3