typst/tests/lang/typ/if-invalid.typ
2021-02-17 21:30:20 +01:00

29 lines
413 B
XML

// Test invalid if syntax.
---
// Error: 4 expected expression
#if
// Error: 4 expected expression
{if}
// Error: 6 expected body
#if x
// Error: 1-6 unexpected keyword `#else`
#else {}
---
// Should output `x`.
// Error: 4 expected expression
#if
x {}
// Should output `something`.
// Error: 6 expected body
#if x something
// Should output `A thing.`
// Error: 20 expected body
A#if false {} #else thing