Skip to content
Permalink
Browse files

Extract generation of random minute into function

  • Loading branch information...
lauft committed Mar 2, 2019
1 parent 544ebfa commit e6b409144deeb9d68686f92c0eac5d028841580e
Showing with 6 additions and 1 deletion.
  1. +6 −1 test/timemachine
@@ -1,5 +1,10 @@
#!/bin/bash

function random_minute()
{
echo "0$( rand -M 60 )" | sed "s|.\+\(..\)\$|\1|g"
}

function default_hours()
{
seq -w 0 23
@@ -40,7 +45,7 @@ until [[ -z "${1}" ]] ; do
done

for day in ${days-$(date --rfc-3339=date)} ; do
for minute in ${minutes-$(echo "0$(rand -M 60)" | sed "s|.\+\(..\)\$|\1|g")} ; do
for minute in ${minutes-$( random_minute )} ; do
for hour in ${hours-$( default_hours )} ; do
date="${day}T${hour}:${minute}"
for single_test in ${tests} ; do

0 comments on commit e6b4091

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.