summaryrefslogtreecommitdiff
path: root/tests/suite
diff options
context:
space:
mode:
authorPgBiel <9021226+PgBiel@users.noreply.github.com>2024-10-11 05:19:58 -0300
committerGitHub <noreply@github.com>2024-10-11 08:19:58 +0000
commit16736feb13eec87eb9ca114deaeb4f7eeb7409d2 (patch)
tree6d7144ef8e91803079401929827b5f61147d6414 /tests/suite
parentb5b92e21e9ae345cd900602ddbc6e3a980f538f3 (diff)
Fix hashing of equal decimals with different scales (#5179)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'tests/suite')
-rw-r--r--tests/suite/foundations/decimal.typ7
1 files changed, 7 insertions, 0 deletions
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\")")