]> arthur.barton.de Git - bup.git/blobdiff - t/test-meta.sh
subtree-hash: handle non-ASCII path chars
[bup.git] / t / test-meta.sh
index 1363598593f04c65499b80ac90f4c2a52751a178..573ad8c4083ea1a1fcee4668e2803ead9346868d 100755 (executable)
@@ -158,7 +158,8 @@ WVSTART 'metadata save/restore (general)'
     # Test a deeper subdir/ to make sure top-level non-dir metadata is
     # restored correctly.  We need at least one dir and one non-dir at
     # the "top-level".
-    WVPASS test -f src/share/man/man1/bup.1
+    WVPASS test -d src/bin
+    WVPASS test -f src/bin/bup
     WVPASS rm -rf "$BUP_DIR"
     WVPASS bup init
     WVPASS touch -t 201111111111 src-restore # Make sure the top won't match.
@@ -169,8 +170,14 @@ WVSTART 'metadata save/restore (general)'
     WVPASS touch -t 201211111111 src-restore # Make sure the top won't match.
     # Check that the only difference is the top dir.
     WVFAIL $TOP/t/compare-trees -c src/lib/ src-restore/ > tmp-compare-trees
-    WVPASSEQ $(cat tmp-compare-trees | wc -l) 2
-    WVPASS tail -n +2 tmp-compare-trees | WVPASS grep -qE '^\.d[^ ]+ \./$'
+    WVPASSEQ $(cat tmp-compare-trees | wc -l) 1
+    # Note: OS X rsync itemize output is currently only 9 chars, not 11.
+    expected_diff_rx='^\.d\.\.t.\.\.\.\.?\.? \./$'
+    if ! grep -qE "$expected_diff_rx" tmp-compare-trees; then
+        echo -n 'tmp-compare-trees: ' 1>&2
+        cat tmp-compare-trees 1>&2
+    fi
+    WVPASS grep -qE "$expected_diff_rx" tmp-compare-trees
     WVPASS rm -r "$tmpdir"
 ) || exit $?