Root/
| 1 | #!/bin/bash |
| 2 | . ./Common |
| 3 | |
| 4 | ############################################################################### |
| 5 | |
| 6 | tst "substitutions: unconditional end" -ds -q <<EOF |
| 7 | !-s |
| 8 | end |
| 9 | EOF |
| 10 | |
| 11 | expect <<EOF |
| 12 | end |
| 13 | EOF |
| 14 | |
| 15 | #------------------------------------------------------------------------------ |
| 16 | |
| 17 | tst "substitutions: conditional end, taken" -ds -q doit=y <<EOF |
| 18 | !-s |
| 19 | doit = y { end } |
| 20 | foo = x |
| 21 | EOF |
| 22 | |
| 23 | expect <<EOF |
| 24 | doit=RE { |
| 25 | end |
| 26 | } |
| 27 | foo=x |
| 28 | EOF |
| 29 | |
| 30 | #------------------------------------------------------------------------------ |
| 31 | |
| 32 | tst "substitutions: conditional end, not taken" -q doit=n <<EOF |
| 33 | !-s |
| 34 | doit = y { end } |
| 35 | foo = x |
| 36 | EOF |
| 37 | |
| 38 | expect <<EOF |
| 39 | foo=x |
| 40 | EOF |
| 41 | |
| 42 | #------------------------------------------------------------------------------ |
| 43 | |
| 44 | tst_fail "substitutions: code after end" -q <<EOF |
| 45 | !-s |
| 46 | end |
| 47 | foo = x |
| 48 | EOF |
| 49 | |
| 50 | expect <<EOF |
| 51 | s:2: unreachable code |
| 52 | EOF |
| 53 | |
| 54 | ############################################################################### |
| 55 |
Branches:
master
