typst/tests/lang/typ/if-invalid.typ
2021-01-31 22:43:11 +01:00

29 lines
427 B
XML

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