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