########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1982-2010 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# David Korn <dgk@research.att.com> #
# #
########################################################################
function err_exit
{
print -u2 -n "\t"
let Errors+=1
}
alias err_exit='err_exit $LINENO'
integer Errors=0
alias foo='print hello'
then err_exit 'foo, where foo is alias for "print hello" failed'
fi
then err_exit 'foo world, where foo is alias for "print hello" failed'
fi
alias foo='print hello '
then err_exit 'foo bar, where foo is alias for "print hello " failed'
fi
then err_exit 'foo \bar, where foo is alias for "print hello " failed'
fi
alias bar='foo world'
if [[ $(bar) != 'hello world' ]]
then err_exit 'bar, where bar is alias for "foo world" failed'
fi
if [[ $(alias bar) != "bar='foo world'" ]]
then err_exit 'alias bar, where bar is alias for "foo world" failed'
fi
unset bar
then err_exit 'alias bar, where bar is alias for "print foo$bar" failed'
fi
unset bar
alias bar='print hello'
if [[ $bar != '' ]]
then err_exit 'alias bar cause variable bar to be set'
fi
alias !!=print
then err_exit 'alias for !!=print not working'
fi
alias foo=echo
then err_exit 'alias in command substitution not working'
fi
( unalias foo)
then err_exit 'alias not working after unalias in subshell'
fi
fi
do print ':' > $tmp/$i
done
else err_exit 'hash -r failed'
fi