diff options
author | Chet Ramey <chet.ramey@case.edu> | 2015-06-17 08:34:54 -0400 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2015-06-17 08:34:54 -0400 |
commit | bd6a350e7e6467ba2b239ec37d2b4a54f5ee5def (patch) | |
tree | c0f79b3368df40b45ac1172758c33d4d6c4e01c8 /tests | |
parent | 1573ba78f3a645a05e87e69c33c78df449a6c16e (diff) | |
download | bash-bd6a350e7e6467ba2b239ec37d2b4a54f5ee5def.tar.gz |
commit bash-20150612 snapshot
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/RUN-ONE-TEST | 2 | ||||
-rw-r--r-- | tests/alias.right | 8 | ||||
-rw-r--r-- | tests/alias.tests | 1 | ||||
-rw-r--r-- | tests/alias2.sub | 22 | ||||
-rw-r--r-- | tests/exec.right | 13 | ||||
-rw-r--r-- | tests/exec11.sub | 14 | ||||
-rw-r--r-- | tests/execscript | 1 | ||||
-rw-r--r-- | tests/exp.right | 6 | ||||
-rw-r--r-- | tests/exp.tests | 1 | ||||
-rw-r--r-- | tests/exp7.sub | 11 |
10 files changed, 78 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/alias.right b/tests/alias.right index a37080ce..cab07a98 100644 --- a/tests/alias.right +++ b/tests/alias.right @@ -10,3 +10,11 @@ OK OK OK OK +one +two +three +four +one +two +three +four diff --git a/tests/alias.tests b/tests/alias.tests index a97d5ff4..d1ba97b3 100644 --- a/tests/alias.tests +++ b/tests/alias.tests @@ -37,3 +37,4 @@ foo bar unalias foo bar baz ${THIS_SH} ./alias1.sub +${THIS_SH} ./alias2.sub diff --git a/tests/alias2.sub b/tests/alias2.sub new file mode 100644 index 00000000..e72a380b --- /dev/null +++ b/tests/alias2.sub @@ -0,0 +1,22 @@ +THIS=alias2 +FN=$THIS.script + +cat > $FN <<'EOF' +# +(echo "$1") +EOF +chmod u+x $FN + +shopt -s expand_aliases + +alias foo1='$FN one; source $FN two; source $FN three; $FN four' + +alias foo2='$FN one +source $FN two +source $FN three +$FN four' + +foo1 +foo2 + +rm -f $FN diff --git a/tests/exec.right b/tests/exec.right index 19c8583e..3c2a7fcd 100644 --- a/tests/exec.right +++ b/tests/exec.right @@ -67,4 +67,17 @@ PATH = /usr/local/bin:/usr/GNU/bin:/usr/bin:/bin:. cannot find cat in $TMPDIR with hash cannot find cat with empty $PATH with hash PATH = /usr/local/bin:/usr/GNU/bin:/usr/bin:/bin:. +trap -- 'echo foo $BASH_SUBSHELL' EXIT +trap -- 'echo USR1 $BASHPID' SIGUSR1 +between +trap -- 'echo foo $BASH_SUBSHELL' EXIT +trap -- 'echo USR1 $BASHPID' SIGUSR1 +between 2 +trap -- 'echo foo $BASH_SUBSHELL' EXIT +trap -- 'echo USR1 $BASHPID' SIGUSR1 +in subshell: 1 +in subshell pipeline: 1 +group pipeline: 1 +EXIT-group.1 +foo 0 after diff --git a/tests/exec11.sub b/tests/exec11.sub new file mode 100644 index 00000000..9631c672 --- /dev/null +++ b/tests/exec11.sub @@ -0,0 +1,14 @@ +trap 'echo USR1 $BASHPID' USR1 +trap 'echo foo $BASH_SUBSHELL' 0 + +trap | cat +echo between +( trap ) +echo between 2 +{ trap; } | cat + +( echo in subshell: $BASH_SUBSHELL ) +( echo in subshell pipeline: $BASH_SUBSHELL ) | cat + +{ echo group pipeline: $BASH_SUBSHELL; + trap 'echo EXIT-group.$BASH_SUBSHELL' EXIT; } | cat diff --git a/tests/execscript b/tests/execscript index f886f2b0..f9c7aca5 100644 --- a/tests/execscript +++ b/tests/execscript @@ -113,6 +113,7 @@ ${THIS_SH} -i ./exec8.sub ${THIS_SH} ./exec9.sub ${THIS_SH} ./exec10.sub +${THIS_SH} ./exec11.sub true | `echo true` & diff --git a/tests/exp.right b/tests/exp.right index 3c5fb8a5..bff55bdc 100644 --- a/tests/exp.right +++ b/tests/exp.right @@ -210,3 +210,9 @@ argv[1] = <correct> argv[2] = <a> argv[1] = <correct> argv[2] = <a> +argv[1] = <^A> +argv[1] = <3> +argv[2] = <^C> +argv[3] = <^C> +argv[4] = <^C> +argv[1] = <^A> diff --git a/tests/exp.tests b/tests/exp.tests index 53eeaa85..54bf722e 100644 --- a/tests/exp.tests +++ b/tests/exp.tests @@ -402,3 +402,4 @@ ${THIS_SH} ./exp4.sub ${THIS_SH} ./exp5.sub ${THIS_SH} ./exp6.sub +${THIS_SH} ./exp7.sub diff --git a/tests/exp7.sub b/tests/exp7.sub new file mode 100644 index 00000000..0a4acc3c --- /dev/null +++ b/tests/exp7.sub @@ -0,0 +1,11 @@ +IFS=$'\001' +c=$'\001' +c2=$'\003' + +IFS=$c # this is the problem line, IFS should end up being \001 +recho "$IFS" +set -- $c2$c$c2$c$c2 +recho $# "$1" "$2" "$3" + +x=$c +recho "$x" |