Root/b2/test/subprint

1#!/bin/bash
2. ./Common
3
4###############################################################################
5
6tst "substitutions: print input variable" -ds -q foo=bar <<EOF
7!-s
8print foo
9EOF
10
11expect <<EOF
12print foo
13foo(in) = "bar"
14EOF
15
16#------------------------------------------------------------------------------
17
18tst "substitutions: print output variable" -q <<EOF
19!-s
20foo = x
21print foo
22EOF
23
24expect <<EOF
25foo(out) = "x"
26foo=x
27EOF
28
29#------------------------------------------------------------------------------
30
31tst "substitutions: print output variable overriding input" -q x=y <<EOF
32!-s
33x = z
34print x
35EOF
36
37expect <<EOF
38x(out) = "z"
39x=z
40EOF
41
42#------------------------------------------------------------------------------
43
44tst "substitutions: print unknown variable" -q <<EOF
45!-s
46print x
47EOF
48
49expect <<EOF
50x = ?
51EOF
52
53#------------------------------------------------------------------------------
54
55tst "substitutions: print conditionally defined variable" -q x=y <<EOF
56!-s
57x=y { z=1 }
58print z
59EOF
60
61expect <<EOF
62z(out) = "1"
63z=1
64EOF
65
66#------------------------------------------------------------------------------
67
68tst "substitutions: print conditionally undefined variable" -q x=z <<EOF
69!-s
70x=y { z=1 }
71print z
72EOF
73
74expect <<EOF
75z = ?
76EOF
77
78###############################################################################
79

Archive Download this file

Branches:
master



interactive