summaryrefslogtreecommitdiff
path: root/tests/typ/base/assert.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-03 16:50:26 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-03 16:50:26 +0100
commit33928a00dc58250e24da1dae4e5db17e7b598d70 (patch)
tree451083aa64f57b442359875b0415541463cb1a0c /tests/typ/base/assert.typ
parent46921a8c283718402322d4d09c0bd1d9194278b1 (diff)
Tidy up library
Diffstat (limited to 'tests/typ/base/assert.typ')
-rw-r--r--tests/typ/base/assert.typ23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/typ/base/assert.typ b/tests/typ/base/assert.typ
new file mode 100644
index 00000000..b0c8aafd
--- /dev/null
+++ b/tests/typ/base/assert.typ
@@ -0,0 +1,23 @@
+// Test the `assert` function.
+// Ref: false
+
+---
+#assert(1 + 1 == 2)
+#assert(range(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")
+#test(type(10 / 3), "float")