16 lines
382 B
Go
16 lines
382 B
Go
package observability
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
"errors"
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestInstrumentDependencyCheckPreservesResult(t *testing.T) {
|
||
|
|
expected := errors.New("unavailable")
|
||
|
|
check := InstrumentDependencyCheck("test", "dependency", func(context.Context) error { return expected })
|
||
|
|
if err := check(context.Background()); !errors.Is(err, expected) {
|
||
|
|
t.Fatalf("error = %v", err)
|
||
|
|
}
|
||
|
|
}
|