diff options
author | Colin Watson <cjwatson@debian.org> | 2010-01-31 18:29:45 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2010-01-31 18:29:45 +0000 |
commit | 95d70483696ac780943c44d69dcdcfa9c389967a (patch) | |
tree | da380ab6208b472dfd052b9459f3b062f015eabe /t/macro/if.sdf | |
parent | 1b2f718a79168c4f1dfe80edd9eb22f142ca44b9 (diff) |
Import upstream version 2.001+1
Diffstat (limited to 't/macro/if.sdf')
-rw-r--r-- | t/macro/if.sdf | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/t/macro/if.sdf b/t/macro/if.sdf new file mode 100644 index 0000000..68feb21 --- /dev/null +++ b/t/macro/if.sdf @@ -0,0 +1,80 @@ +# This file tests conditional text + +# Test the if section +!define CITY 'Brisbane' +!if &Var("CITY") eq 'Brisbane' +Monday's weather will be fine and hot +with an afternoon thunderstorm. +!else +No information for Monday. +!endif + +# Test the else section +!define CITY 'Sydney' +!if &Var("CITY") eq 'Brisbane' +Tuesday's weather will be fine and hot +with an afternoon thunderstorm. +!else +No information for Tuesday. +!endif + +# Test the elsif section +!define CITY 'Sydney' +!if &Var("CITY") eq 'Brisbane' +Wednesday's weather will be fine and hot +with an afternoon thunderstorm. +!elsif &Var("CITY") eq 'Sydney' +Sydney will be fine on Wednesday. +!else +No information for Wednesday. +!endif + +# Test the if section when an elsif is present +!define CITY 'Brisbane' +!if &Var("CITY") eq 'Brisbane' +Thursday's weather will be fine and hot +with an afternoon thunderstorm. +!elsif &Var("CITY") eq 'Sydney' +Sydney will be fine on Thursday. +!else +No information for Thursday. +!endif + +# Test the else section when an elsif is present +!define CITY 'Melbourne' +!if &Var("CITY") eq 'Brisbane' +Friday's weather will be fine and hot +with an afternoon thunderstorm. +!elsif &Var("CITY") eq 'Sydney' +Sydney will be fine on Friday. +!else +No information for Friday. +!endif + +# Test nested stuff - if inside an if +!define abc +!define xyz +!if abc +Inside abc. +!if xyz +Inside xyz +!else +Else part of xyz. +!endif +!else +Else part of abc. +!endif + +# Test nested stuff - else inside an if +!define abc +!define xyz 0 +!if abc +Inside abc. +!if xyz +Inside xyz +!else +Else part of xyz. +!endif +!else +Else part of abc. +!endif |