about summary refs log tree commit diff
path: root/Test/Y01completion.ztst
blob: a2aa007177280090c6c77a9978750ad1e0af8433 (plain) (blame)
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
# Tests for completion system.

%prep
  if ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then
    . $ZTST_srcdir/comptest
    mkdir comp.tmp
    cd comp.tmp
    comptestinit -z $ZTST_testdir/../Src/zsh &&
    {
      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 '_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}

# 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

%clean

  zmodload -ui zsh/zpty