2 # errors -- empty stack
6 # errors -- bad numeric arguments -- should not cause the script to exit
12 unalias cd 2>/dev/null
20 *) echo oops -- bad \$OLDPWD ;;
28 # this should not change the directory stack at all
40 # two consecutive `pushd's should swap the top two stack elements, then
41 # swap them back, leaving the stack intact
46 echo ${DIRSTACK[0]} ; dirs +0
47 echo ${DIRSTACK[2]} ; dirs +2
49 # these should be errors, but not affect the directory stack
78 # this is for the benefit of pure coverage