aboutsummaryrefslogtreecommitdiff
path: root/aux/tests-lib.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-06-22 18:18:05 -0300
committerEuAndreh <eu@euandre.org>2021-06-22 18:24:15 -0300
commitd5297540b17e1fe8ff0971bbc06184eb29c080e6 (patch)
tree6c72564b5ea06dd8ca0db05f4a68592bd544ff00 /aux/tests-lib.sh
parentsrc/git-permalink.sh.in, tests/remotes.sh: Address ShellCheck issues (diff)
downloadgit-permalink-d5297540b17e1fe8ff0971bbc06184eb29c080e6.tar.gz
git-permalink-d5297540b17e1fe8ff0971bbc06184eb29c080e6.tar.xz
aux/tests-lib.sh: Add uuid() function, use it on tests
Diffstat (limited to 'aux/tests-lib.sh')
-rwxr-xr-xaux/tests-lib.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/aux/tests-lib.sh b/aux/tests-lib.sh
index 0be4e6f..007282a 100755
--- a/aux/tests-lib.sh
+++ b/aux/tests-lib.sh
@@ -102,3 +102,11 @@ test_ok() {
# shellcheck disable=2059
printf " ${green}OK${end}.\n" >&2
}
+
+uuid() {
+ # Taken from:
+ # https://serverfault.com/a/799198
+ od -xN20 /dev/urandom | \
+ head -1 | \
+ awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}'
+}