package internal import ( "errors" "testing" ) func TestSetupBPFModuleErrorWrapsStage(t *testing.T) { cause := errors.New("boom") err := setupBPFModuleError("load object", cause) if err == nil { t.Fatalf("expected wrapped error") } if got, want := err.Error(), "setup BPF module: load object: boom"; got != want { t.Fatalf("wrapped error = %q, want %q", got, want) } if !errors.Is(err, cause) { t.Fatalf("expected wrapped error to retain original cause") } } func TestSetupBPFModuleErrorNil(t *testing.T) { if err := setupBPFModuleError("attach probes", nil); err != nil { t.Fatalf("expected nil error passthrough, got %v", err) } }