container: initialise cmd early
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m29s
Test / Hakurei (push) Successful in 4m15s
Test / Sandbox (race detector) (push) Successful in 4m43s
Test / Hpkg (push) Successful in 4m48s
Test / Hakurei (race detector) (push) Successful in 6m9s
Test / Flake checks (push) Successful in 1m18s

This allows use of more cmd methods.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-09-13 19:50:17 +09:00
parent e271fa77aa
commit 3f25c3f0af
3 changed files with 66 additions and 23 deletions

View File

@@ -11,10 +11,10 @@ import (
)
func TestContainer(t *testing.T) {
t.Run("start empty container", func(t *testing.T) {
t.Run("start invalid container", func(t *testing.T) {
h := helper.New(t.Context(), container.MustAbs(container.Nonexistent), "hakurei", argsWt, false, argF, nil, nil)
wantErr := "container: starting an empty container"
wantErr := "container: starting an invalid container"
if err := h.Start(); err == nil || err.Error() != wantErr {
t.Errorf("Start: error = %v, wantErr %q",
err, wantErr)