negative wait WIP
This commit is contained in:
parent
add7e8acb9
commit
9a8acbbcab
|
@ -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…
Reference in New Issue