zsh-users
 help / color / mirror / code / Atom feed
cbfbb75d7f1d33341a6a24b8a5b22ff6ae45ab43 blob 3375 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
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
 
# Tests for completion system.

%prep
  if [[ $OSTYPE = cygwin ]]; then
    ZTST_unimplemented="the zsh/zpty module does not work on Cygwin"
  elif ( zmodload zsh/zpty 2>/dev/null ); then
    . $ZTST_srcdir/comptest
    mkdir comp.tmp
    cd comp.tmp
    comptestinit -z $ZTST_testdir/../Src/zsh &&
    {
      comptesteval 'compdef _tst tst'
      mkdir dir1 &&
      mkdir dir2 &&
      touch file1 &&
      touch file2
    }
  else
    ZTST_unimplemented="the zsh/zpty module is not available"
  fi

%test

  comptest $': \t\t\t\t\t\t\t'
0:directories and files
>line: {: }{}
>DESCRIPTION:{file}
>DI:{dir1}
>DI:{dir2}
>FI:{file1}
>FI:{file2}
>line: {: dir1/}{}
>line: {: dir2/}{}
>line: {: file1}{}
>line: {: file2}{}
>line: {: dir1/}{}
>line: {: dir2/}{}

  comptesteval 'zsh_directory_name () {
    case "$1" in
      (d)
        return 1
      ;;
      (n)
        reply=("$2")
      ;;
      (c)
        local expl
        _wanted dynamic-dirs expl dynamic compadd -S\] -Q -- ./
      ;;
    esac
  }'
  comptest $': ~[\t/\t\t\t\t\t\t\t'
0:tilde with zsh_directory_name
>line: {: ~[./]}{}
>line: {: ~[./]/}{}
>DESCRIPTION:{file}
>DI:{dir1}
>DI:{dir2}
>FI:{file1}
>FI:{file2}
>line: {: ~[./]/dir1/}{}
>line: {: ~[./]/dir2/}{}
>line: {: ~[./]/file1}{}
>line: {: ~[./]/file2}{}
>line: {: ~[./]/dir1/}{}
>line: {: ~[./]/dir2/}{}

  comptesteval '_users () { compadd user1 user2 }'
  comptest $': ~\t\t\t\t\t'
0:tilde
>line: {: ~user}{}
>line: {: ~user}{}
>NO:{user1}
>NO:{user2}
>line: {: ~user1}{}
>line: {: ~user2}{}
>line: {: ~user1}{}

  comptest $'echo ;:\C-b\C-b\t'
0:directories and files before separator
>line: {echo }{;:}
>DESCRIPTION:{file}
>DI:{dir1}
>DI:{dir2}
>FI:{file1}
>FI:{file2}

  # Temporarily modify format set in comptest
  comptesteval 'zstyle -s ":completion:*:descriptions" format oldfmt'
  comptesteval 'zstyle ":completion:*:descriptions" format \
    ${oldfmt/>*</>%5F123abc%f %B123abc%b<}'
  comptest $': \t'
  comptesteval 'zstyle ":completion:*:descriptions" format $oldfmt'
0:custom description with formatting sequences
>line: {: }{}
*>DESCRIPTION:{*123abc*123abc*~*F123*}
>DI:{dir1}
>DI:{dir2}
>FI:{file1}
>FI:{file2}
F:regression test workers/42164

# Depends on path assignment in comptestinit
  comptesteval "path=( $ZTST_srcdir:A )"
  comptest $'zt\t'
0:command
>line: {ztst.zsh }{}

  comptesteval "path=( $ZTST_srcdir:A )"
  comptest $':;zt\t'
0:command after separator
>line: {:;ztst.zsh }{}
F:regression test workers/32182

  comptest $'for f in 1; do < x\C-b\C-b\t'
0:redirection after "for ...; do"
>line: {for f in 1; do <}{ x}
>DESCRIPTION:{file}
>DI:{dir1}
>DI:{dir2}
>FI:{file1}
>FI:{file2}
F:regression test workers/31611

  {
    mkdir 'A(B)' 'A(B)/C'
    comptest $'cd "A(B)\t\t'
    comptesteval 'cd "A(B)/C"'
    comptest $'cd ../\t'
  } always {
    rmdir 'A(B)/C' 'A(B)'
  }
0:directory name is not a glob qualifier
>line: {cd "A(B)/}{}
>line: {cd "A(B)/C/}{}
>line: {cd ../C/}{}

  comptesteval "_tst() { compadd -U -s : -S / -I . word; compstate[to_end]= }"
  comptest $'tst .\C-b\t'
0:allow for suffixes when moving cursor to end of match (with ignored suffix)
>line: {tst word:/}{.}

  comptesteval "_tst() { compadd -s : -S / word; compstate[to_end]= }"
  comptest $'tst \t'
0:allow for suffixes when moving cursor to end of match (without ignored suffix)
>line: {tst word:/}{}

%clean

  zmodload -ui zsh/zpty
debug log:

solving cbfbb75d7 ...
found cbfbb75d7 in https://inbox.vuxu.org/zsh-users/20180223002950.2892-1-thb@laafc.net/
found b1c0e40e5 in https://git.vuxu.org/mirror/zsh/
preparing index
index prepared:
100644 b1c0e40e59f3215272944021697504c5acfec8f9	Test/Y01completion.ztst

applying [1/1] https://inbox.vuxu.org/zsh-users/20180223002950.2892-1-thb@laafc.net/
diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst
index b1c0e40e5..cbfbb75d7 100644

Checking patch Test/Y01completion.ztst...
Applied patch Test/Y01completion.ztst cleanly.

index at:
100644 cbfbb75d7f1d33341a6a24b8a5b22ff6ae45ab43	Test/Y01completion.ztst

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).