]> arthur.barton.de Git - bup.git/blobdiff - t/test-tz.sh
test-tz.sh: test save in a fractional time zone
[bup.git] / t / test-tz.sh
diff --git a/t/test-tz.sh b/t/test-tz.sh
new file mode 100755 (executable)
index 0000000..4b566b1
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+. ./wvtest-bup.sh || exit $?
+
+set -o pipefail
+
+top="$(WVPASS pwd)" || exit $?
+tmpdir="$(WVPASS wvmktempdir)" || exit $?
+
+export BUP_DIR="$tmpdir/bup"
+export GIT_DIR="$tmpdir/bup"
+
+bup() { "$top/bup" "$@"; }
+
+WVSTART "half hour TZ"
+
+export TZ=ACDT-10:30
+
+WVPASS bup init
+WVPASS cd "$tmpdir"
+
+WVPASS mkdir src
+WVPASS bup index src
+WVPASS bup save -n src -d 1420164180 src
+
+WVPASSEQ "$(WVPASS git cat-file commit src | sed -ne 's/^author .*> //p')" \
+"1420164180 +1030"
+
+WVPASSEQ "$(WVPASS bup ls /src)" \
+"2015-01-02-123300
+latest"
+
+WVPASS rm -rf "$tmpdir"