summaryrefslogtreecommitdiffstats
path: root/test/t2300-pkgmaint.t
diff options
context:
space:
mode:
authorFrédéric Mangano-Tarumi <fmang@mg0.fr>2020-02-23 19:53:13 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2020-02-27 16:44:36 +0100
commite374a91febe53b72ff4cb73b153348f067374c68 (patch)
tree038973590aace5ba4f4899cc256d843ef2505867 /test/t2300-pkgmaint.t
parent81d55e70ee0469018af86d203ceaf2fece691ea8 (diff)
downloadaur-e374a91febe53b72ff4cb73b153348f067374c68.tar.gz
aur-e374a91febe53b72ff4cb73b153348f067374c68.tar.xz
Change the extension of TAP test suites to .t
This is the common convention for TAP, and makes harnesses like prove automatically detect them. Plus, test suites don’t have to be shell scripts anymore. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'test/t2300-pkgmaint.t')
-rwxr-xr-xtest/t2300-pkgmaint.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/t2300-pkgmaint.t b/test/t2300-pkgmaint.t
new file mode 100755
index 00000000..478df526
--- /dev/null
+++ b/test/t2300-pkgmaint.t
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+test_description='pkgmaint tests'
+
+. ./setup.sh
+
+test_expect_success 'Test package base cleanup script.' '
+ now=$(date -d now +%s) &&
+ threedaysago=$(date -d "3 days ago" +%s) &&
+ cat <<-EOD | sqlite3 aur.db &&
+ INSERT INTO PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS, FlaggerComment) VALUES (1, "foobar", 1, $now, 0, "");
+ INSERT INTO PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS, FlaggerComment) VALUES (2, "foobar2", 2, $threedaysago, 0, "");
+ INSERT INTO PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS, FlaggerComment) VALUES (3, "foobar3", NULL, $now, 0, "");
+ INSERT INTO PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS, FlaggerComment) VALUES (4, "foobar4", NULL, $threedaysago, 0, "");
+ EOD
+ "$PKGMAINT" &&
+ cat <<-EOD >expected &&
+ foobar
+ foobar2
+ foobar3
+ EOD
+ echo "SELECT Name FROM PackageBases;" | sqlite3 aur.db >actual &&
+ test_cmp actual expected
+'
+
+test_done