source: MondoRescue/branches/2.2.9/mindi-busybox/shell/hush_test/hush-vars/param_expand_assign.tests@ 3320

Last change on this file since 3320 was 3320, checked in by Bruno Cornec, 9 years ago
  • Re-add (thanks git BTW) the 2.2.9 branch which had been destroyed in the move to 3.0
  • Property svn:executable set to *
File size: 874 bytes
Line 
1# first try some invalid patterns (do in subshell due to parsing error)
2"$THIS_SH" -c 'echo ${=}'
3"$THIS_SH" -c 'echo ${:=}'
4
5# now some funky ones
6"$THIS_SH" -c 'echo ${#=}'
7"$THIS_SH" -c 'echo ${#:=}'
8
9# should error out
10"$THIS_SH" -c 'set --; echo _${1=}'
11"$THIS_SH" -c 'set --; echo _${1:=}'
12"$THIS_SH" -c 'set --; echo _${1=word}'
13"$THIS_SH" -c 'set --; echo _${1:=word}'
14
15# should not error
16"$THIS_SH" -c 'set aa; echo _${1=}'
17"$THIS_SH" -c 'set aa; echo _${1:=}'
18"$THIS_SH" -c 'set aa; echo _${1=word}'
19"$THIS_SH" -c 'set aa; echo _${1:=word}'
20
21# should work fine
22unset f; echo _$f
23unset f; echo _${f=}
24unset f; echo _${f:=}
25unset f; echo _${f=word}
26unset f; echo _${f:=word}
27
28f=; echo _$f
29f=; echo _${f=}
30f=; echo _${f:=}
31f=; echo _${f=word}
32f=; echo _${f:=word}
33
34f=fff; echo _$f
35f=fff; echo _${f=}
36f=fff; echo _${f:=}
37f=fff; echo _${f=word}
38f=fff; echo _${f:=word}
Note: See TracBrowser for help on using the repository browser.