diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-15 02:10:22 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-15 02:10:22 +0900 |
| commit | 0f1f0e43643d302494c0dac8bbc3eda7813f06bb (patch) | |
| tree | 4730fd645c2b958a48495ee4a5644e538bf0ba8b /helper/direct_test.go | |
| parent | f9bf20a3c75d01cf597477231f9bbb61f15cd4fd (diff) | |
helper: combine helper ipc setup
The two-step args call is no longer necessary since stat is passed on initialisation.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'helper/direct_test.go')
| -rw-r--r-- | helper/direct_test.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/helper/direct_test.go b/helper/direct_test.go deleted file mode 100644 index 6431edec..00000000 --- a/helper/direct_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package helper_test - -import ( - "context" - "errors" - "os" - "os/exec" - "testing" - - "git.gensokyo.uk/security/fortify/helper" -) - -func TestDirect(t *testing.T) { - t.Run("start non-existent helper path", func(t *testing.T) { - h := helper.NewDirect(context.Background(), "/nonexistent", argsWt, false, argF, nil) - - if err := h.Start(); !errors.Is(err, os.ErrNotExist) { - t.Errorf("Start: error = %v, wantErr %v", - err, os.ErrNotExist) - } - }) - - t.Run("valid new helper nil check", func(t *testing.T) { - if got := helper.NewDirect(context.TODO(), "fortify", argsWt, false, argF, nil); got == nil { - t.Errorf("New(%q, %q) got nil", - argsWt, "fortify") - return - } - }) - - t.Run("implementation compliance", func(t *testing.T) { - testHelper(t, func(ctx context.Context, cmdF func(cmd *exec.Cmd), stat bool) helper.Helper { - return helper.NewDirect(ctx, "crash-test-dummy", argsWt, stat, argF, cmdF) - }) - }) -} |
