summaryrefslogtreecommitdiff
path: root/tests/typ/utility
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-10-05 19:37:38 +0200
committerLaurenz <laurmaedje@gmail.com>2021-10-05 19:37:38 +0200
commit0a23bfbc23ec68ed229b78c8f9995928c133c4a6 (patch)
treeb3f4c13e634e387a2133a31cf7094dd6f56dd33d /tests/typ/utility
parent58d1cc68d92b2b81ea402bd33389ecbcacf1d755 (diff)
Add `assert` function
Diffstat (limited to 'tests/typ/utility')
-rw-r--r--tests/typ/utility/basics.typ16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/typ/utility/basics.typ b/tests/typ/utility/basics.typ
index a2f6b220..3cd4ffa9 100644
--- a/tests/typ/utility/basics.typ
+++ b/tests/typ/utility/basics.typ
@@ -2,6 +2,22 @@
// Ref: false
---
+// Test the `assert` function.
+#assert(1 + 1 == 2)
+#assert(2..5 == (2, 3, 4))
+#assert(not false)
+
+---
+// Test failing assertions.
+// Error: 9-15 assertion failed
+#assert(1 == 2)
+
+---
+// Test failing assertions.
+// Error: 9-15 expected boolean, found string
+#assert("true")
+
+---
// Test the `type` function.
#test(type(1), "integer")
#test(type(ltr), "direction")