mirror of https://github.com/hashicorp/consul
parent
e0e96496f1
commit
3d202b59bc
|
@ -1,9 +1,7 @@
|
||||||
package ae
|
package ae
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -58,22 +56,3 @@ func TestAE_nestedPauseResume(t *testing.T) {
|
||||||
}()
|
}()
|
||||||
l.Resume()
|
l.Resume()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAE_ifNotPausedRun(t *testing.T) {
|
|
||||||
l := NewStateSyner(nil, 0, nil, nil)
|
|
||||||
|
|
||||||
errCalled := errors.New("f called")
|
|
||||||
f := func() error { return errCalled }
|
|
||||||
|
|
||||||
l.Pause()
|
|
||||||
err := l.ifNotPausedRun(f)
|
|
||||||
if got, want := err, errPaused; !reflect.DeepEqual(got, want) {
|
|
||||||
t.Fatalf("got error %q want %q", got, want)
|
|
||||||
}
|
|
||||||
l.Resume()
|
|
||||||
|
|
||||||
err = l.ifNotPausedRun(f)
|
|
||||||
if got, want := err, errCalled; got != want {
|
|
||||||
t.Fatalf("got error %q want %q", got, want)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue