summaryrefslogtreecommitdiff
path: root/tests/typ/code/if.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-07-30 18:37:04 +0200
committerLaurenz <laurmaedje@gmail.com>2021-07-30 18:49:20 +0200
commite35fca54a0c5b3cd5251a58837e9c1ef2b6c3c6d (patch)
tree21afd717101000209cd35d07df8034864f29c41f /tests/typ/code/if.typ
parent1ee1d078e2480ddd08d40915bc7a74a8352acff0 (diff)
Change indent from 4 to 2 spaces
Diffstat (limited to 'tests/typ/code/if.typ')
-rw-r--r--tests/typ/code/if.typ50
1 files changed, 25 insertions, 25 deletions
diff --git a/tests/typ/code/if.typ b/tests/typ/code/if.typ
index db8b059e..174e6978 100644
--- a/tests/typ/code/if.typ
+++ b/tests/typ/code/if.typ
@@ -3,46 +3,46 @@
---
// Test condition evaluation.
#if 1 < 2 [
- One.
+ One.
]
#if true == false [
- {Bad}, but we {dont-care}!
+ {Bad}, but we {dont-care}!
]
---
// Braced condition.
#if {true} [
- One.
+ One.
]
// Template in condition.
#if [] != none [
- Two.
+ Two.
]
// Multi-line condition with parens.
#if (
- 1 + 1
- == 1
+ 1 + 1
+ == 1
) [
- Nope.
+ Nope.
] #else {
- "Three."
+ "Three."
}
// Multiline.
#if false [
- Bad.
+ Bad.
] #else {
- let point = "."
- "Four" + point
+ let point = "."
+ "Four" + point
}
// Template can be argument or body depending on whitespace.
{
- if "template" == type[b] [Fi] else [Nope]
- if "template" == type [Nope] else [ve.]
+ if "template" == type[b] [Fi] else [Nope]
+ if "template" == type [Nope] else [ve.]
}
---
@@ -50,21 +50,21 @@
// Ref: false
{
- let x = 1
- let y = 2
- let z
+ let x = 1
+ let y = 2
+ let z
- // Returns if branch.
- z = if x < y { "ok" }
- test(z, "ok")
+ // Returns if branch.
+ z = if x < y { "ok" }
+ test(z, "ok")
- // Returns else branch.
- z = if x > y { "bad" } else { "ok" }
- test(z, "ok")
+ // Returns else branch.
+ z = if x > y { "bad" } else { "ok" }
+ test(z, "ok")
- // Missing else evaluates to none.
- z = if x > y { "bad" }
- test(z, none)
+ // Missing else evaluates to none.
+ z = if x > y { "bad" }
+ test(z, none)
}
---