summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@parabola.nu>2024-02-21 09:29:07 -0700
committerLuke T. Shumaker <lukeshu@parabola.nu>2024-02-21 10:18:52 -0700
commit7b9538d383841c7deb286dd0b8f31a5c40cb5d0f (patch)
treef5833c257b8df6064f6bd1a2e9652968722ef97e
parent63d3993a320ee03c20da05d0e04ddbd3cc800335 (diff)
test: librefetch.bats: Add some failing testcases [ci-skip]
-rw-r--r--test/cases/librefetch.bats28
-rw-r--r--test/fixtures/librefetch/PKGBUILD-bz219
-rw-r--r--test/fixtures/librefetch/PKGBUILD-split24
3 files changed, 71 insertions, 0 deletions
diff --git a/test/cases/librefetch.bats b/test/cases/librefetch.bats
index 439553f..21150bb 100644
--- a/test/cases/librefetch.bats
+++ b/test/cases/librefetch.bats
@@ -129,3 +129,31 @@ setup() {
empty "$tmpdir/workdir/srcdest/$srcball"
gpg --quiet --verify "$tmpdir/workdir/srcdest/$srcball"{.sig,} 2>/dev/null
}
+
+@test "librefetch handles split packages" {
+ cp fixtures/librefetch/* "$tmpdir/"
+ cd "$tmpdir"
+ mv PKGBUILD{-split,}
+
+ makepkg -g
+}
+
+@test "librefetch uses the specified compression" {
+ cp fixtures/librefetch/* "$tmpdir/"
+ cd "$tmpdir"
+ local srcball
+
+ # Both gzip and bzip2 are in 'base', so this choice of
+ # compression methods doesn't add anything to our list of
+ # dependencies.
+
+ srcball=testpkg-1.0.tar.gz
+ mv PKGBUILD{-mksource,}
+ makepkg -g
+ gzip -d <"$tmpdir/workdir/srcdest/$srcball" >/dev/null
+
+ srcball=testpkg-bz2-1.0.tar.bz2
+ mv PKGBUILD{-bz2,}
+ makepkg -g
+ bzip2 -d <"$tmpdir/workdir/srcdest/$srcball" >/dev/null
+}
diff --git a/test/fixtures/librefetch/PKGBUILD-bz2 b/test/fixtures/librefetch/PKGBUILD-bz2
new file mode 100644
index 0000000..0d688b8
--- /dev/null
+++ b/test/fixtures/librefetch/PKGBUILD-bz2
@@ -0,0 +1,19 @@
+pkgname=testpkg-bz2
+pkgver=1.0
+pkgrel=1
+pkgdesc=foo
+arch=(any)
+source=("libre://$pkgname-$pkgver.tar.bz2"{,.sig})
+backup=(etc/testpkg.conf)
+
+mksource() {
+ mkdir "$srcdir/bar"
+ local file
+ for file in '~foo' '~a' a A; do
+ touch "$srcdir/bar/$file"
+ done
+}
+
+package() {
+ :;
+}
diff --git a/test/fixtures/librefetch/PKGBUILD-split b/test/fixtures/librefetch/PKGBUILD-split
new file mode 100644
index 0000000..a979f08
--- /dev/null
+++ b/test/fixtures/librefetch/PKGBUILD-split
@@ -0,0 +1,24 @@
+pkgbase=testpkg-split
+pkgname=(testpkg-split testpkg-split-secondary)
+pkgver=1.0
+pkgrel=1
+pkgdesc=foo
+arch=(any)
+source=("libre://$pkgname-$pkgver.tar.gz"{,.sig})
+backup=(etc/testpkg.conf)
+
+mksource() {
+ mkdir "$srcdir/bar"
+ local file
+ for file in '~foo' '~a' a A; do
+ touch "$srcdir/bar/$file"
+ done
+}
+
+package_testpkg-split() {
+ :;
+}
+
+package_testpkg-split-secondary() {
+ :;
+}