about summary refs log tree commit homepage
path: root/t/t0300-async_sinatra.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-01-24 23:13:41 +0000
committerEric Wong <normalperson@yhbt.net>2013-02-01 21:46:27 +0000
commit0ba6fc3c30b9cf530faf7fcf5ce7be519ec13fe7 (patch)
tree90fe5c93c6b05a8a8613d6557dfcb3a10f68de9d /t/t0300-async_sinatra.sh
parentcbff7b0892148b037581541184364e0e91d2a138 (diff)
downloadrainbows-0ba6fc3c30b9cf530faf7fcf5ce7be519ec13fe7.tar.gz
"date +%s" is not in POSIX (it is in GNU, and at least FreeBSD
9.0, possibly earlier).  The Ruby equivalent should be
sufficiently portable between different Ruby versions.

This change was automated via:
	perl -i -p -e 's/date \+%s/unix_time/' t/*.sh
Diffstat (limited to 't/t0300-async_sinatra.sh')
-rwxr-xr-xt/t0300-async_sinatra.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t0300-async_sinatra.sh b/t/t0300-async_sinatra.sh
index ef612b8..ae594eb 100755
--- a/t/t0300-async_sinatra.sh
+++ b/t/t0300-async_sinatra.sh
@@ -24,7 +24,7 @@ t_begin "setup and start" && {
 }
 
 t_begin "send async requests off in parallel" && {
-        t0=$(date +%s)
+        t0=$(unix_time)
         ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | tee $a) &
         ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | tee $b) &
         ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | tee $c) &
@@ -32,7 +32,7 @@ t_begin "send async requests off in parallel" && {
 
 t_begin "ensure elapsed requests were processed in parallel" && {
         wait
-        t1=$(date +%s)
+        t1=$(unix_time)
         elapsed=$(( $t1 - $t0 ))
         echo "elapsed=$elapsed < 30"
         test $elapsed -lt 30