aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/pkg_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/pkg/pkg_test.go')
-rw-r--r--internal/pkg/pkg_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/pkg/pkg_test.go b/internal/pkg/pkg_test.go
index 060dea6d..3df040d2 100644
--- a/internal/pkg/pkg_test.go
+++ b/internal/pkg/pkg_test.go
@@ -1603,6 +1603,24 @@ func (a earlyFailureF) Cure(*pkg.FContext) error {
return stub.UniqueError(0xcafe)
}
+func BenchmarkEarlyDCE(b *testing.B) {
+ msg := message.New(log.New(os.Stderr, "dce: ", 0))
+ msg.SwapVerbose(testing.Verbose())
+ c, err := pkg.Open(b.Context(), msg, 0, 0, 0, check.MustAbs(b.TempDir()))
+ if err != nil {
+ b.Fatal(err)
+ }
+ _, _, err = c.Cure(earlyFailureF(8))
+ if !errors.Is(err, stub.UniqueError(0xcafe)) {
+ b.Fatalf("Cure: error = %v", err)
+ }
+ c.Close()
+
+ for b.Loop() {
+ err.Error()
+ }
+}
+
func TestDependencyCureErrorEarly(t *testing.T) {
t.Parallel()