summaryrefslogtreecommitdiffstatshomepage
path: root/test/tst-status-once.sh
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-09-29 23:44:16 +0500
committerEgor Tensin <egor@tensin.name>2026-09-29 23:45:40 +0500
commiteec673b5c0122e359bf00b0136783a32e8a77df9 (patch)
tree61457ccf0d65331f1411b28aa7ba2ad964191ba2 /test/tst-status-once.sh
parentremove annoying trailing period from repo URLs (diff)
downloadvk-scripts-1.2.0.tar.gz
vk-scripts-1.2.0.zip
test: rework using the approach from my other projectsv1.2.0
The tests are now run using a framework common to my other projects, like config-links & tag-release.
Diffstat (limited to 'test/tst-status-once.sh')
-rw-r--r--test/tst-status-once.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/tst-status-once.sh b/test/tst-status-once.sh
new file mode 100644
index 0000000..1623d25
--- /dev/null
+++ b/test/tst-status-once.sh
@@ -0,0 +1,25 @@
+test_run() {
+ test_setup
+
+ local users=(egor.tensin kreed58)
+ local db_path
+ db_path="$test_root_dir/db.csv"
+
+ test_run_module vk.tracking.status --only-once -o "$db_path" "${users[@]}"
+
+ if [ ! -s "$db_path" ]; then
+ fail "Database file '$db_path' either doesn't exists or is empty"
+ return 1
+ fi
+
+ log "Database:"
+ cat -- "$db_path" >&2
+
+ local lines
+ lines="$( cat -- "$db_path" | wc -l )"
+
+ if [ "$lines" -ne 2 ]; then
+ fail "Database '$db_path' has the wrong number of entries"
+ return 1
+ fi
+}