Change debconf text to claim that the default /bin/sh is dash instead of bash. close...
[posh.git] / tests / quoting.t
blob6d38c98d46e5359a4a8057a0ab0087a6a0cce8ff
1 # These tests deal with quoting.
3 name: quoting-1
4 description:
5         Check that quoting by means of backslash
6 category: debian,posix
7 stdin:
8         echo \|\&\;\<\>\(\)\$\`\\\"\'\ \        \
9         This a continuation of the echo line.
10 expected-stdout:
11         |&;<>()$`\"'    This a continuation of the echo line.
12 ---
13 name: quoting-2
14 description:
15         Check single-quoting
16 category: debian,posix
17 stdin:
18         FULLVARIABLE="Two words"
19         echo 'One $EMPTYVARIABLE'
20         echo 'Two ${EMPTYVARIABLE}'
21         echo '$(echo cmdsubst $FULLVARIABLE)'
22         echo '`echo backquot $FULLVARIABLE`'
23 expected-stdout:
24         One $EMPTYVARIABLE
25         Two ${EMPTYVARIABLE}
26         $(echo cmdsubst $FULLVARIABLE)
27         `echo backquot $FULLVARIABLE`
28 ---
29 name: quoting-3
30 description:
31         Check double-quoting
32 category: debian,posix
33 stdin:
34         FULLVARIABLE="Two words"
35         echo "One $EMPTYVARIABLE"
36         echo "Two ${EMPTYVARIABLE}"
37         echo "$(echo cmdsubst $FULLVARIABLE)"
38         echo "`echo backquot $FULLVARIABLE`"
39 expected-stdout:
40         One 
41         Two 
42         cmdsubst Two words
43         backquot Two words
44 ---
45 name: blsk-nl-ign-5
46 description:
47         Check what happens with backslash at end of input
48         (the old bourne shell trashes them; so do we)
49 stdin: !
50         echo `echo foo\\`bar
51         echo hi\
52 expected-stdout:
53         foobar
54         hi
55 ---
56 name: blsk-nl-10
57 description:
58         Check that \newline in a keyword is collapsed
59 stdin: 
60         i\
61         f true; then\
62          echo pass; el\
63         se echo fail; fi
64 expected-stdout:
65         pass
66 ---