From 33928a00dc58250e24da1dae4e5db17e7b598d70 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 3 Nov 2022 16:50:26 +0100 Subject: Tidy up library --- tests/typ/base/assert.typ | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/typ/base/assert.typ (limited to 'tests/typ/base/assert.typ') 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") -- cgit v1.2.3