diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-01-06 17:46:12 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-01-06 17:46:12 +0900 |
| commit | e7e9b4caea779d2f24be8f213d45b5fa6282db00 (patch) | |
| tree | b39ff679a346780e088b0de3e8f3447795bdcaf1 /internal/pkg/exec_test.go | |
| parent | f6d32e482a391ee9b095bb58f3476dd75420fc64 (diff) | |
internal/pkg: exec nil path check during cure
This results in os.ErrInvalid instead of a panic, which hopefully improves user experience.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/exec_test.go')
| -rw-r--r-- | internal/pkg/exec_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/pkg/exec_test.go b/internal/pkg/exec_test.go index e718b260..25fe8894 100644 --- a/internal/pkg/exec_test.go +++ b/internal/pkg/exec_test.go @@ -96,6 +96,18 @@ func TestExec(t *testing.T) { }, }), ), nil, pkg.Checksum{}, errors.Join(stub.UniqueError(0xcafe))}, + + {"invalid paths", pkg.NewExec( + t.Context(), + msg, + 0, + check.MustAbs("/work"), + []string{"HAKUREI_TEST=1"}, + check.MustAbs("/opt/bin/testtool"), + []string{"testtool"}, + + pkg.ExecContainerPath{}, + ), nil, pkg.Checksum{}, os.ErrInvalid}, }) // check init failure passthrough |
