diff options
author | Chet Ramey <chet.ramey@case.edu> | 2011-12-03 22:46:45 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2011-12-03 22:46:45 -0500 |
commit | 4c4d2fbfda13ca52d65390c2af4e31927a23b00e (patch) | |
tree | c32bb481c1c693954272e33a1fcec41bce849364 /tests | |
parent | 591dd2e5f84693c39a404be0d87af1c34de49002 (diff) | |
download | bash-4c4d2fbfda13ca52d65390c2af4e31927a23b00e.tar.gz |
commit bash-20060330 snapshot
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/RUN-ONE-TEST | 2 | ||||
-rw-r--r-- | tests/array.right | 5 | ||||
-rw-r--r-- | tests/array4.sub | 10 | ||||
-rw-r--r-- | tests/array4.sub~ | 30 | ||||
-rw-r--r-- | tests/braces.right | 2 | ||||
-rw-r--r-- | tests/braces.tests | 5 | ||||
-rw-r--r-- | tests/braces.tests~ | 70 |
7 files changed, 123 insertions, 1 deletions
diff --git a/tests/RUN-ONE-TEST b/tests/RUN-ONE-TEST index 3efcf32d..72ec06a2 100755 --- a/tests/RUN-ONE-TEST +++ b/tests/RUN-ONE-TEST @@ -1,4 +1,4 @@ -BUILD_DIR=/usr/local/build/chet/bash/bash-current +BUILD_DIR=/usr/local/build/bash/bash-current THIS_SH=$BUILD_DIR/bash PATH=$PATH:$BUILD_DIR diff --git a/tests/array.right b/tests/array.right index 900e43e3..9545aaa7 100644 --- a/tests/array.right +++ b/tests/array.right @@ -139,6 +139,11 @@ value = new1 new2 new3 7 8 9 8 11 8 11 +6 +nordholz +8 +8 +8 a b c d e f g for case if then else diff --git a/tests/array4.sub b/tests/array4.sub index 9d7e1afb..474eaedd 100644 --- a/tests/array4.sub +++ b/tests/array4.sub @@ -18,3 +18,13 @@ echo $a $b typeset -i a b a=(5+3) b=(4+7) echo $a $b + +let a=(4*3)/2 +echo $a + +LNAME=nordholz +echo ${LNAME} +echo ${#LNAME} + +echo ${#LNAME[$(( 0 ))]} +echo ${#LNAME[$(( 0+0 ))]} diff --git a/tests/array4.sub~ b/tests/array4.sub~ new file mode 100644 index 00000000..f61d7a96 --- /dev/null +++ b/tests/array4.sub~ @@ -0,0 +1,30 @@ +# compound assignment parsing problems in bash-3.1-release +func() +{ + local -a x=() y=() +} + +a=() b=() +eval foo=() +eval foo=() bar=() qux=( "bash" ) + +foo=( "bash" ) +eval foo=( "bash" ) +eval bar=( "bash" ) bax=( "bash" ) + +let a=(5 + 3) b=(4 + 7) +echo $a $b + +typeset -i a b +a=(5+3) b=(4+7) +echo $a $b + +a=(4*3)/2 +echo $a + +LNAME=nordholz +echo ${LNAME} +echo ${#LNAME} + +echo ${#LNAME[$(( 0 ))]} +echo ${#LNAME[$(( 0+0 ))]} diff --git a/tests/braces.right b/tests/braces.right index 3d7ef8e7..f00d39a7 100644 --- a/tests/braces.right +++ b/tests/braces.right @@ -41,3 +41,5 @@ f 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 +a-{bd}-c a-{be}-c +a-{bdef-g-c a-{bdef-i-c diff --git a/tests/braces.tests b/tests/braces.tests index 3f57829f..5a57f284 100644 --- a/tests/braces.tests +++ b/tests/braces.tests @@ -68,3 +68,8 @@ echo 0{1..9} {10..20} # do negative numbers work? echo {-1..-10} echo {-20..0} + +# weirdly-formed brace expansions -- fixed in post-bash-3.1 +echo a-{b{d,e}}-c + +echo a-{bdef-{g,i}-c diff --git a/tests/braces.tests~ b/tests/braces.tests~ new file mode 100644 index 00000000..3f57829f --- /dev/null +++ b/tests/braces.tests~ @@ -0,0 +1,70 @@ +echo ff{c,b,a} +echo f{d,e,f}g +echo {l,n,m}xyz +echo {abc\,def} +echo {abc} + +echo \{a,b,c,d,e} +echo {x,y,\{a,b,c}} +echo {x\,y,\{abc\},trie} + +echo /usr/{ucb/{ex,edit},lib/{ex,how_ex}} + +echo XXXX\{`echo a b c | tr ' ' ','`\} +eval echo XXXX\{`echo a b c | tr ' ' ','`\} + +echo {} +echo { } +echo } +echo { +echo abcd{efgh + +echo foo {1,2} bar +echo `zecho foo {1,2} bar` +echo $(zecho foo {1,2} bar) + +var=baz +varx=vx +vary=vy + +echo foo{bar,${var}.} +echo foo{bar,${var}} + +echo "${var}"{x,y} +echo $var{x,y} +echo ${var}{x,y} + +unset var varx vary + +# new sequence brace operators +echo {1..10} + +# this doesn't work yet +echo {0..10,braces} +# but this does +echo {{0..10},braces} +echo x{{0..10},braces}y + +echo {3..3} +echo x{3..3}y +echo {10..1} +echo {10..1}y +echo x{10..1}y + +echo {a..f} +echo {f..a} + +echo {a..A} +echo {A..a} + +echo {f..f} + +# mixes are incorrectly-formed brace expansions +echo {1..f} +echo {f..1} + +echo 0{1..9} {10..20} + +# do negative numbers work? +echo {-1..-10} +echo {-20..0} |