test(coverage): raise engine+agent coverage above 50%

This commit is contained in:
Deivid Soto 2026-05-12 11:21:59 +02:00
parent e89b647dfa
commit bf18812a3d
10 changed files with 839 additions and 2 deletions

View file

@ -0,0 +1,22 @@
//go:build !windows
package agent
import (
"os"
"testing"
)
func TestIsProcessAliveSelf(t *testing.T) {
if !IsProcessAlive(os.Getpid()) {
t.Errorf("self PID should be alive")
}
}
func TestIsProcessAliveBogus(t *testing.T) {
// PID 0 is reserved (signal 0 to PID 0 broadcasts to the whole pgrp).
// Pick a very high PID unlikely to exist.
if IsProcessAlive(0x7FFFFFFE) {
t.Errorf("very high PID should not be alive")
}
}