diff options
Diffstat (limited to 'tests/typ/base/assert.typ')
| -rw-r--r-- | tests/typ/base/assert.typ | 23 |
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") |
