diff options
author | EuAndreh <eu@euandre.org> | 2023-03-31 19:26:53 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-03-31 19:26:53 -0300 |
commit | 49787ab49be82ce3ed1527b662d022bed3e7c8b9 (patch) | |
tree | b1bf177b48f636c3138d84bcfcf1b7c868c98f17 /tests/lib.sh | |
parent | Release v0.3.0 (diff) | |
download | remembering-49787ab49be82ce3ed1527b662d022bed3e7c8b9.tar.gz remembering-49787ab49be82ce3ed1527b662d022bed3e7c8b9.tar.xz |
Do not depend on m4 for anything
Diffstat (limited to 'tests/lib.sh')
-rwxr-xr-x | tests/lib.sh | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/lib.sh b/tests/lib.sh index 527e645..d144bef 100755 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -119,26 +119,23 @@ test_ok() { } uuid() { - # Taken from: - # https://serverfault.com/a/799198 od -xN20 /dev/urandom | - head -1 | + head -n1 | awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}' } tmpname() { - echo 'mkstemp(template)' | m4 -D template="${TMPDIR:-/tmp}/m4-tmpname." + printf '%s/uuid-tmpname with spaces.%s' "${TMPDIR:-/tmp}" "$(uuid)" } mkstemp() { name="$(tmpname)" - touch "$name" - echo "$name" + touch -- "$name" + printf '%s' "$name" } mkdtemp() { name="$(tmpname)" - rm -f "$name" - mkdir "$name" - echo "$name" + mkdir -- "$name" + printf '%s' "$name" } |