mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-08-25 16:15:31 +03:00
49 lines
919 B
Bash
Executable File
49 lines
919 B
Bash
Executable File
#!/bin/bash
|
|
. ./Common
|
|
|
|
###############################################################################
|
|
|
|
tst "substitutions: F1 -> FN (expand \$\$)" -q F1=foo <<EOF
|
|
!-s
|
|
FN=* { RES=\$\$ }
|
|
EOF
|
|
|
|
expect <<EOF
|
|
RES=foo
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst "substitutions: F2 -> FN (expand \$\$)" -q F1=foo F2=bar <<EOF
|
|
!-s
|
|
FN=?a? { RES=\$\$ }
|
|
EOF
|
|
|
|
expect <<EOF
|
|
RES=bar
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst_fail "substitutions: F* -> FN (expand \$FN)" -q F1=foo <<EOF
|
|
!-s
|
|
FN=* { RES=\$FN }
|
|
EOF
|
|
|
|
expect <<EOF
|
|
s:2: \$FN may be undefined
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst_fail "substitutions: assign to FN" <<EOF
|
|
!-s
|
|
FN=foo
|
|
EOF
|
|
|
|
expect <<EOF
|
|
s:2: can't assign to pseudo-variable FN
|
|
EOF
|
|
|
|
###############################################################################
|