mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Add tests for aurblup
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
cc66259d33
commit
c8c3747786
2 changed files with 59 additions and 0 deletions
53
test/t2400-aurblup.sh
Executable file
53
test/t2400-aurblup.sh
Executable file
|
@ -0,0 +1,53 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='aurblup tests'
|
||||
|
||||
. ./setup.sh
|
||||
|
||||
test_expect_success 'Test official provider update script.' '
|
||||
mkdir -p remote/test/foobar-1.0-1 &&
|
||||
cat <<-EOD >remote/test/foobar-1.0-1/desc &&
|
||||
%FILENAME%
|
||||
foobar-1.0-any.pkg.tar.xz
|
||||
|
||||
%NAME%
|
||||
foobar
|
||||
|
||||
%VERSION%
|
||||
1.0-1
|
||||
|
||||
%ARCH%
|
||||
any
|
||||
EOD
|
||||
mkdir -p remote/test/foobar2-1.0-1 &&
|
||||
cat <<-EOD >remote/test/foobar2-1.0-1/desc &&
|
||||
%FILENAME%
|
||||
foobar2-1.0-any.pkg.tar.xz
|
||||
|
||||
%NAME%
|
||||
foobar2
|
||||
|
||||
%VERSION%
|
||||
1.0-1
|
||||
|
||||
%ARCH%
|
||||
any
|
||||
|
||||
%PROVIDES%
|
||||
foobar3
|
||||
foobar4
|
||||
EOD
|
||||
( cd remote/test && bsdtar -czf ../test.db * ) &&
|
||||
mkdir sync &&
|
||||
"$AURBLUP" &&
|
||||
cat <<-EOD >expected &&
|
||||
foobar|test|foobar
|
||||
foobar2|test|foobar2
|
||||
foobar2|test|foobar3
|
||||
foobar2|test|foobar4
|
||||
EOD
|
||||
echo "SELECT Name, Repo, Provides FROM OfficialProviders ORDER BY Provides;" | sqlite3 aur.db >actual &&
|
||||
test_cmp actual expected
|
||||
'
|
||||
|
||||
test_done
|
Loading…
Add table
Add a link
Reference in a new issue