blob: ed19b6d96d49a7a99298e909944694ba02585d07 (
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
|
load ../lib/common
setup() {
common_setup
install -Dm644 /dev/stdin "$XDG_CONFIG_HOME/libretools/libredbdiff.conf" <<-'eot'
statedir="$PWD"
mirror_prbl='https://repo.parabola.nu/$repo/os/$arch'
mirror_arch='https://mirrors.kernel.org/archlinux/$repo/os/$arch'
repos=(libre)
eot
}
@test "libredbdiff displays help" {
LC_ALL=C libredbdiff -h >$tmpdir/stdout 2>$tmpdir/stderr
[[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]]
empty $tmpdir/stderr
}
@test "libredbdiff handles packages with multiple provides explicit" {
cd fixtures/libredbdiff/statedir
libredbdiff -n libre >$tmpdir/stdout 2>$tmpdir/stderr
empty $tmpdir/stderr
diff -w ../expected-explicit.txt $tmpdir/stdout
}
@test "libredbdiff handles packages with multiple provides implicit" {
cd fixtures/libredbdiff/statedir
libredbdiff -n >$tmpdir/stdout 2>$tmpdir/stderr
empty $tmpdir/stderr
diff -w ../expected-implicit.txt $tmpdir/stdout
}
@test "libredbdiff fails on bad repo args" {
cd fixtures/libredbdiff/statedir
libredbdiff -n bogus >$tmpdir/stdout 2>$tmpdir/stderr || status=$?
[[ $status != 0 ]]
empty $tmpdir/stdout
not empty $tmpdir/stderr
}
|