mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-27 07:39:43 +02:00
79 lines
1.3 KiB
Bash
Executable File
79 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
. ./Common
|
|
|
|
###############################################################################
|
|
|
|
tst "substitutions: print input variable" -ds -q foo=bar <<EOF
|
|
!-s
|
|
print foo
|
|
EOF
|
|
|
|
expect <<EOF
|
|
print foo
|
|
foo(in) = "bar"
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst "substitutions: print output variable" -q <<EOF
|
|
!-s
|
|
foo = x
|
|
print foo
|
|
EOF
|
|
|
|
expect <<EOF
|
|
foo(out) = "x"
|
|
foo=x
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst "substitutions: print output variable overriding input" -q x=y <<EOF
|
|
!-s
|
|
x = z
|
|
print x
|
|
EOF
|
|
|
|
expect <<EOF
|
|
x(out) = "z"
|
|
x=z
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst "substitutions: print unknown variable" -q <<EOF
|
|
!-s
|
|
print x
|
|
EOF
|
|
|
|
expect <<EOF
|
|
x = ?
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst "substitutions: print conditionally defined variable" -q x=y <<EOF
|
|
!-s
|
|
x=y { z=1 }
|
|
print z
|
|
EOF
|
|
|
|
expect <<EOF
|
|
z(out) = "1"
|
|
z=1
|
|
EOF
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
tst "substitutions: print conditionally undefined variable" -q x=z <<EOF
|
|
!-s
|
|
x=y { z=1 }
|
|
print z
|
|
EOF
|
|
|
|
expect <<EOF
|
|
z = ?
|
|
EOF
|
|
|
|
###############################################################################
|