$OpenBSD: patch-tests_playTests_sh,v 1.12 2019/11/06 10:19:15 bket Exp $

date(1) has no option for displaying the modification time of a file. 'head -c' is non-portable.

Index: tests/playTests.sh
--- tests/playTests.sh.orig
+++ tests/playTests.sh
@@ -227,8 +227,8 @@ sleep 5
 $ZSTD --exclude-compressed --long --rm -r precompressedFilterTestDir
 test ! -f precompressedFilterTestDir/input.5.zst.zst
 test ! -f precompressedFilterTestDir/input.6.zst.zst
-file1timestamp=`date -r precompressedFilterTestDir/input.5.zst +%s`
-file2timestamp=`date -r precompressedFilterTestDir/input.7.zst +%s`
+file1timestamp=`stat -f %m precompressedFilterTestDir/input.5.zst`
+file2timestamp=`stat -f %m precompressedFilterTestDir/input.7.zst`
 if [[ $file2timestamp -ge $file1timestamp ]]; then
   println "Test is successful. input.5.zst is precompressed and therefore not compressed/modified again."
 else
@@ -274,7 +274,7 @@ test -f tmp.zst  # destination file should still be pr
 rm -rf tmp*  # may also erase tmp* directory from previous failed run
 
 println "\n===> decompression only tests "
-head -c 1048576 /dev/zero > tmp
+dd bs=1 count=1048576 if=/dev/zero of=tmp
 $ZSTD -d -o tmp1 "$TESTDIR/golden-decompression/rle-first-block.zst"
 $DIFF -s tmp1 tmp
 rm tmp*
@@ -1173,9 +1173,9 @@ rm -f tmp* dictionary
 if [ "$isWindows" = false ] ; then
 
 println "\n===>  zstd fifo named pipe test "
-head -c 10 /dev/zero > tmp_original
+dd bs=1 count=10 if=/dev/zero of=tmp_original
 mkfifo named_pipe
-head -c 10 /dev/zero > named_pipe &
+dd bs=1 count=10 if=/dev/zero of=named_pipe &
 $ZSTD named_pipe -o tmp_compressed
 $ZSTD -d -o tmp_decompressed tmp_compressed
 $DIFF -s tmp_original tmp_decompressed
