mirror of
https://github.com/garethgeorge/backrest.git
synced 2025-12-16 18:45:36 +00:00
17 lines
428 B
Go
17 lines
428 B
Go
package hook
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
|
|
v1 "github.com/garethgeorge/backrest/gen/go/v1"
|
|
)
|
|
|
|
// TestApplyHookErrorPolicy tests that applyHookErrorPolicy is defined for all values of Hook_OnError.
|
|
func TestApplyHookErrorPolicy(t *testing.T) {
|
|
values := v1.Hook_OnError(0).Descriptor().Values()
|
|
for i := 0; i < values.Len(); i++ {
|
|
applyHookErrorPolicy(v1.Hook_OnError(values.Get(i).Number()), errors.New("an error"))
|
|
}
|
|
}
|