zsh-workers
 help / color / mirror / code / Atom feed
b294e65ca5755331d7f4d1a8d4ddf821414e319f blob 2029 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
 
# 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

  alias -g '&&=(){ return $?; } && '
  alias not_the_print_command=print
  eval 'print This is output
  && print And so is this
  && { print And this too; false; }
  && print But not this
  && print Nor this
  true
  && not_the_print_command And aliases are expanded'
0:We can now alias special tokens.  Woo hoo.
>This is output
>And so is this
>And this too
>And aliases are expanded

  $ZTST_testdir/../Src/zsh -fis <<<'
  unsetopt PROMPT_SP
  PROMPT="" PS2="" PS3="" PS4="" RPS1="" RPS2=""
  exec 2>&1
  alias \{=echo
  { begin
  {end
  fc -l -2' 2>/dev/null
0:Aliasing reserved tokens
>begin
>end
*>*5*{ begin
*>*6*{end

  $ZTST_testdir/../Src/zsh -fis <<<'
  unsetopt PROMPT_SP
  PROMPT="" PS2="" PS3="" PS4="" RPS1="" RPS2=""
  exec 2>&1
  alias -g S=\"
  echo S a string S "
  fc -l -1' 2>/dev/null
0:Global aliasing quotes
> a string S 
*>*5*echo S a string S "
# Note there is a trailing space on the "> a string S " line

  (
  unalias -a
  alias
  )
0:unalias -a

  alias -s foo=print
  unalias -as
0:unalias -as
debug log:

solving b294e65 ...
found b294e65 in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).