summaryrefslogtreecommitdiffhomepage
path: root/tests/linux/i-dscomplete.sh
blob: 14d5d44b46231a889810288d1d447f308e2874ec (plain)
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
# Interactive: completion of MVS names (data sets, members, DD names).
# Off z/OS the catalog is a stand-in (ZASH_TEST_CATALOG, see sys_posix.c)
# that is turned into real CSI work areas, PDS directory blocks and TIOT
# entries, so this drives the same decoding the z/OS build uses.
command -v python3 >/dev/null 2>&1 || exit 77
{
    echo "X SYS1"
    echo "SYS1.MACLIB"
    echo "SYS1.MACLIB(GETMAIN)"
    echo "SYS1.MACLIB(FREEMAIN)"
    echo "SYS1.MACLIB(IEFJFCB)"
    echo "SYS1.MACROS.OLD"
    echo "SYS1.MODGEN"
    echo "SYS1.PARMLIB"
    echo "DD:SYSIN"
    echo "DD:SYSPRINT"
    echo "DD:STEPLIB"
    # enough entries to need several CSI calls (resume) and directory blocks
    i=1
    while [ $i -le 150 ]; do
        echo "BIG.DATA.SET$i"
        echo "BIG.PDS(M$i)"
        i=$((i + 1))
    done
} >catalog
PS1='$ ' ENV='' HISTFILE='' ZASH_TEST_CATALOG=$PWD/catalog \
    python3 "$TESTS/tools/ptydrive.py" "$TSH" <<'END'
# quoted absolute name: one qualifier at a time, lower case folded
send echo "//'sys1.mac\t\t
expect MACROS.
send \x03
send echo "//'SYS1.MACL\t\r
expect //'SYS1.MACLIB'
# a qualifier with more below it ends in "." and takes another Tab
send echo "//'SYS1.MACR\tO\t\r
expect //'SYS1.MACROS.OLD'
# a high-level qualifier on its own is not searched at all: a filter like
# SYS* would have Catalog Management resolve aliases across catalogs
send echo "//'SY\t\tZ\r
expect //'SYZ
send \x03
# members of a PDS, quoted and closed
send echo "//'SYS1.MACLIB(GE\t\r
expect //'SYS1.MACLIB(GETMAIN)'
send echo "//'SYS1.MACLIB(\t\t
expect IEFJFCB
send \x03
# escaped instead of double-quoted: the editor adds the backslashes
send echo //\\'SYS1.PARM\t\r
expect //'SYS1.PARMLIB'
# many entries: resume across work areas (the list is cut to one screen,
# so the proof is that the 149th entry is still completable)
send echo "//'BIG.DATA.SET1\t\t
expect ... and
send \x03
send echo "//'BIG.DATA.SET149\t\r
expect //'BIG.DATA.SET149'
send echo "//'BIG.PDS(M150\t\r
expect //'BIG.PDS(M150)'
# DD names
send echo //DD:SYSP\t\r
expect //DD:SYSPRINT
# no match: bell, nothing inserted
send echo "//'NOSUCH.\t\tZ\r
expect //'NOSUCH.Z
send \x03
send exit\r
END