blob: 9410f9c1157d14af001a0874ea7aa5cbac02757d (
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
|
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "slapt-src -"
sync_after_int
set test "--bu<TAB> should complete \"--build\""
assert_complete "--build" "slapt-src --bu" $test
sync_after_int
set test "--ins<TAB> should complete \"--install\""
assert_complete "--install" "slapt-src --ins" $test
sync_after_int
set test "--install should complete available packages"
set config $::srcdir/fixtures/slackware/etc/slapt-get/slapt-srcrc
set workdir [file normalize $::srcdir/fixtures/slackware/usr/src/slapt-src/]
set slb_data "$workdir/slackbuilds_data"
set f [open $config w]; puts $f "BUILDDIR=$workdir"; close $f
set slackbuilds [split [exec bash -c "sed -n \
-e '/^SLACKBUILD NAME: /{s/^SLACKBUILD NAME: \\{1,\\}//;p}' \
-e '/^SLACKBUILD VERSION: /{s/^SLACKBUILD VERSION: \\{1,\\}//;p}' \
$slb_data | sed -e 'N;s/\\n/:/'"] "\n"]
assert_complete $slackbuilds "slapt-src --config $config --install " $test
sync_after_int
teardown
|