1 # This program is free software: you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation, either version 3 of the License, or
4 # (at your option) any later version.
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU General Public License for more details.
11 # You should have received a copy of the GNU General Public License
12 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # error -- non-existent directory
19 pushd /tmp/xxx-notthere
21 # errors -- empty stack
25 # errors -- bad numeric arguments -- should not cause the script to exit
32 unalias cd 2>/dev/null
37 command pwd -P # better be `/'
41 *) echo oops -- bad \$OLDPWD ;;
49 # this should not change the directory stack at all
61 # two consecutive `pushd's should swap the top two stack elements, then
62 # swap them back, leaving the stack intact
67 echo ${DIRSTACK[0]} ; dirs +0
68 echo ${DIRSTACK[2]} ; dirs +2
70 # these should be errors, but not affect the directory stack
99 # this is for the benefit of pure coverage