From 6e65ebf23641a755b0088569751c0b02e898f1e9 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 19 Feb 2023 21:08:01 +0100 Subject: Panic function --- tests/typ/compute/foundations.typ | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tests') 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 @@ -10,11 +10,31 @@ #test(repr(ltr), "ltr") #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 -- cgit v1.2.3