mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-17 21:16:15 +02:00
b2/test/{subend,subign}: test end/ignore in substitutions
This commit is contained in:
parent
bca50f009f
commit
a52247294b
54
b2/test/subend
Executable file
54
b2/test/subend
Executable file
@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
. ./Common
|
||||
|
||||
###############################################################################
|
||||
|
||||
tst "substitutions: unconditional end" -ds -q <<EOF
|
||||
!-s
|
||||
end
|
||||
EOF
|
||||
|
||||
expect <<EOF
|
||||
end
|
||||
EOF
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
tst "substitutions: conditional end, taken" -ds -q doit=y <<EOF
|
||||
!-s
|
||||
doit = y { end }
|
||||
foo = x
|
||||
EOF
|
||||
|
||||
expect <<EOF
|
||||
doit=RE {
|
||||
end
|
||||
}
|
||||
foo=x
|
||||
EOF
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
tst "substitutions: conditional end, not taken" -q doit=n <<EOF
|
||||
!-s
|
||||
doit = y { end }
|
||||
foo = x
|
||||
EOF
|
||||
|
||||
expect <<EOF
|
||||
foo=x
|
||||
EOF
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
tst_fail "substitutions: code after end" -q <<EOF
|
||||
!-s
|
||||
end
|
||||
foo = x
|
||||
EOF
|
||||
|
||||
expect <<EOF
|
||||
s:2: unreachable code
|
||||
EOF
|
||||
|
||||
###############################################################################
|
56
b2/test/subign
Executable file
56
b2/test/subign
Executable file
@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
. ./Common
|
||||
|
||||
###############################################################################
|
||||
|
||||
tst "substitutions: unconditional ignore" -ds -q <<EOF
|
||||
!-s
|
||||
ignore
|
||||
EOF
|
||||
|
||||
expect <<EOF
|
||||
ignore
|
||||
ignore
|
||||
EOF
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
tst "substitutions: conditional ignore, taken" -ds -q doit=y <<EOF
|
||||
!-s
|
||||
doit = y { ignore }
|
||||
foo = x
|
||||
EOF
|
||||
|
||||
expect <<EOF
|
||||
doit=RE {
|
||||
ignore
|
||||
}
|
||||
foo=x
|
||||
ignore
|
||||
EOF
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
tst "substitutions: conditional ignore, not taken" -q doit=n <<EOF
|
||||
!-s
|
||||
doit = y { ignore }
|
||||
foo = x
|
||||
EOF
|
||||
|
||||
expect <<EOF
|
||||
foo=x
|
||||
EOF
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
tst_fail "substitutions: code after ignore" -q <<EOF
|
||||
!-s
|
||||
ignore
|
||||
foo = x
|
||||
EOF
|
||||
|
||||
expect <<EOF
|
||||
s:2: unreachable code
|
||||
EOF
|
||||
|
||||
###############################################################################
|
Loading…
Reference in New Issue
Block a user