summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-19 21:08:01 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-19 21:08:01 +0100
commit6e65ebf23641a755b0088569751c0b02e898f1e9 (patch)
tree52c19bff69db599bd86ee92250bee40d57af5622 /tests/typ
parent1e681b35c70cbb9c117d9f9b94bb2980753f685d (diff)
Panic function
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/compute/foundations.typ22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/typ/compute/foundations.typ b/tests/typ/compute/foundations.typ
index 83cda65f..eb3e7e35 100644
--- a/tests/typ/compute/foundations.typ
+++ b/tests/typ/compute/foundations.typ
@@ -11,12 +11,32 @@
#test(repr((1, 2, false, )), "(1, 2, false)")
---
+// Test panic.
+// Error: 7-9 panicked
+#panic()
+
+---
+// Test panic.
+// Error: 7-12 panicked with: 123
+#panic(123)
+
+---
+// Test panic.
+// Error: 7-24 panicked with: "this is wrong"
+#panic("this is wrong")
+
+---
// Test failing assertions.
-// Error: 9-15 assertion failed
+// Error: 8-16 assertion failed
#assert(1 == 2)
---
// Test failing assertions.
+// Error: 8-51 assertion failed: two is smaller than one
+#assert(2 < 1, message: "two is smaller than one")
+
+---
+// Test failing assertions.
// Error: 9-15 expected boolean, found string
#assert("true")