summaryrefslogtreecommitdiff
path: root/tests/typ/compiler/ops.typ
diff options
context:
space:
mode:
authorbluebear94 <uruwi@protonmail.com>2023-09-28 05:15:09 -0400
committerGitHub <noreply@github.com>2023-09-28 11:15:09 +0200
commit553da642bdf6f0d360b1d57841fd78bd0dc873b6 (patch)
tree407ecdeaf0bdaebf08567cc7996c49cde9747202 /tests/typ/compiler/ops.typ
parentffcd951bc8a698af99d43f5245aea47a7c09adaf (diff)
Handle compiler panics when handling infinite lengths (#2215)
Diffstat (limited to 'tests/typ/compiler/ops.typ')
-rw-r--r--tests/typ/compiler/ops.typ14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/typ/compiler/ops.typ b/tests/typ/compiler/ops.typ
index 56fdb721..89ed3e5f 100644
--- a/tests/typ/compiler/ops.typ
+++ b/tests/typ/compiler/ops.typ
@@ -129,6 +129,20 @@
#0x123z
---
+// Test that multiplying infinite numbers by certain units does not crash.
+#(float("inf") * 1pt)
+#(float("inf") * 1em)
+#(float("inf") * (1pt + 1em))
+
+---
+// Test that trying to produce a NaN scalar (such as in lengths) does not crash.
+#let infpt = float("inf") * 1pt
+#test(infpt - infpt, 0pt)
+#test(infpt + (-infpt), 0pt)
+// TODO: this result is surprising
+#test(infpt / float("inf"), 0pt)
+
+---
// Test boolean operators.
// Test not.