From e71ae3b8c5b4a8f103a078783fef2f56ee5450a2 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 25 Jul 2025 00:43:22 +0900 Subject: container: remove custom cmd initialisation This part of the interface is very unintuitive and only used for testing, even in testing it is inelegant and can be done better. Signed-off-by: Ophestra --- helper/container_test.go | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'helper/container_test.go') diff --git a/helper/container_test.go b/helper/container_test.go index 71c25bd1..f5dc1aaa 100644 --- a/helper/container_test.go +++ b/helper/container_test.go @@ -4,13 +4,10 @@ import ( "context" "io" "os" - "os/exec" "testing" "hakurei.app/container" "hakurei.app/helper" - "hakurei.app/internal" - "hakurei.app/internal/hlog" ) func TestContainer(t *testing.T) { @@ -36,20 +33,8 @@ func TestContainer(t *testing.T) { testHelper(t, func(ctx context.Context, setOutput func(stdoutP, stderrP *io.Writer), stat bool) helper.Helper { return helper.New(ctx, os.Args[0], argsWt, stat, argF, func(z *container.Container) { setOutput(&z.Stdout, &z.Stderr) - z.CommandContext = func(ctx context.Context) (cmd *exec.Cmd) { - return exec.CommandContext(ctx, os.Args[0], "-test.v", - "-test.run=TestHelperInit", "--", "init") - } z.Bind("/", "/", 0).Proc("/proc").Dev("/dev") }, nil) }) }) } - -func TestHelperInit(t *testing.T) { - if len(os.Args) != 5 || os.Args[4] != "init" { - return - } - container.SetOutput(hlog.Output{}) - container.Init(hlog.Prepare, func(bool) { internal.InstallOutput(false) }) -} -- cgit v1.3.1