summaryrefslogtreecommitdiff
path: root/tests/typ/code/if.typ
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ/code/if.typ')
-rw-r--r--tests/typ/code/if.typ10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/typ/code/if.typ b/tests/typ/code/if.typ
index dd5d23a0..db8b059e 100644
--- a/tests/typ/code/if.typ
+++ b/tests/typ/code/if.typ
@@ -39,9 +39,16 @@
"Four" + point
}
+// Template can be argument or body depending on whitespace.
+{
+ if "template" == type[b] [Fi] else [Nope]
+ if "template" == type [Nope] else [ve.]
+}
+
---
// Value of if expressions.
// Ref: false
+
{
let x = 1
let y = 2
@@ -61,13 +68,12 @@
}
---
-// Ref: false
-
// Condition must be boolean.
// If it isn't, neither branch is evaluated.
// Error: 5-14 expected boolean, found string
#if "a" + "b" { nope } #else { nope }
+---
// Make sure that we don't complain twice.
// Error: 5-12 cannot add integer and string
#if 1 + "2" {}