diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-02 22:20:39 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-02 22:33:04 -0400 |
commit | c9c5a69cc2098e999ddb76d8fd282a3fb6334cb1 (patch) | |
tree | 63c70b7a4a58c9547eab265f5ea2cc58ea4136ef /test/libredbdiff-test.sh | |
parent | a6ef2ffed4af47ff360bf0fc508aa24e83418f97 (diff) |
bugfix [1/2]: libredbdiff: Add a test for handling multiple provides.
Also make the minimal changes to the program to make this testing possible.
Diffstat (limited to 'test/libredbdiff-test.sh')
-rw-r--r-- | test/libredbdiff-test.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/libredbdiff-test.sh b/test/libredbdiff-test.sh new file mode 100644 index 0000000..1b267e3 --- /dev/null +++ b/test/libredbdiff-test.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env roundup + +describe libredbdiff +. ./test-common.sh + +common_before() { + mkdir -p "$XDG_CONFIG_HOME/libretools" + printf '%s\n' \ + 'statedir="$PWD"' \ + "mirror='http://repo.parabola.nu/\$repo/os/\$arch'" \ + "mirrorarch='http://mirrors.kernel.org/archlinux/\$repo/os/\$arch'" \ + > $XDG_CONFIG_HOME/libretools/libredbdiff.conf +} + +it_displays_help() { + LC_ALL=C libredbdiff -h >$tmpdir/stdout 2>$tmpdir/stderr + + [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] + empty $tmpdir/stderr +} + +it_handles_packages_with_multiple_provides() { + cd libredbdiff.d/statedir + + libredbdiff -n libre >$tmpdir/stdout 2>$tmpdir/stderr + + empty $tmpdir/stderr + diff -w ../expected.txt $tmpdir/stdout +} |