summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-05-18 16:31:22 +0200
committerLaurenz <laurmaedje@gmail.com>2021-05-18 16:31:22 +0200
commit72434f069577901f006e8df38c4faeed47b25867 (patch)
treea2903f7c546f29826d6a055880a0c63b7273d4b5 /tests/typ
parent6b08862b83950c32890858431a680f4069cee439 (diff)
Min and max functions
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/library/math.typ15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/typ/library/math.typ b/tests/typ/library/math.typ
new file mode 100644
index 00000000..db234d9c
--- /dev/null
+++ b/tests/typ/library/math.typ
@@ -0,0 +1,15 @@
+// Test math functions.
+// Ref: false
+
+---
+// Test `min` and `max` functions.
+#test(min(2, -4), -4)
+#test(min(3.5, 1e2, -0.1, 3), -0.1)
+#test(max(-3, 11), 11)
+#test(min("hi"), "hi")
+
+// Error: 6 missing argument: value
+#min()
+
+// Error: 11-18 cannot compare integer with string
+#test(min(1, "hi"), error)