negative wait WIP

pull/6129/head
Matthew Hooker 8 years ago
parent add7e8acb9
commit 9a8acbbcab
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1

@ -84,6 +84,12 @@ type waitExpression struct {
// Do waits the amount of time described by the expression. It is cancellable
// through the context.
func (w *waitExpression) Do(ctx context.Context, _ BCDriver) error {
/*
// do I want this to not parse or to error?
if w.d < 0 {
panic("Was not expecting negative wait duration.")
}
*/
log.Printf("[INFO] Waiting %s", w.d)
select {
case <-time.After(w.d):

@ -99,3 +99,18 @@ func Test_special(t *testing.T) {
}
}
}
func Test_negativeWait(t *testing.T) {
in := "<wait-1m>"
_, err := ParseReader("", strings.NewReader(in))
if err != nil {
log.Fatal(err)
}
/*
gL := toIfaceSlice(got)
for _, g := range gL {
assert.Equal(t, tt.out, g.(*specialExpression).String())
}
*/
}

Loading…
Cancel
Save