1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00
zsh/Test/A02alias.ztst
2010-03-25 15:13:35 +00:00

44 lines
1,004 B
Text

# To get the "command not found" message when aliasing is suppressed
# we need, er, a command that isn't found.
# The other aliases are only ever used as aliases.
%prep
alias ThisCommandDefinitelyDoesNotExist=echo
alias -g bar=echo
alias '\bar=echo'
%test
ThisCommandDefinitelyDoesNotExist ThisCommandDefinitelyDoesNotExist
0:Basic aliasing
>ThisCommandDefinitelyDoesNotExist
bar bar
0:Global aliasing
>echo
\ThisCommandDefinitelyDoesNotExist ThisCommandDefinitelyDoesNotExist
127:Not aliasing
?(eval):1: command not found: ThisCommandDefinitelyDoesNotExist
\bar \bar
0:Aliasing with a backslash
>bar
(alias '!=echo This command has the argument'
eval 'print Without
! true'
setopt posixaliases
eval 'print With
! true')
1:POSIX_ALIASES option
>Without
>This command has the argument true
>With
print -u $ZTST_fd 'This test hangs the shell when it fails...'
alias cat='LC_ALL=C cat'
cat <(echo foo | cat)
0:Alias expansion works at the end of parsed strings
>foo