- TestReadPPID, TestReadPPIDMissing - TestResolveWorkspace, TestResolveWorkspaceNotFound, TestResolveWorkspaceMaxDepth - TestBuildTerminalWorkspaceMapUnit - Add go.i3wm.org/i3/v4 dependency
33 lines
948 B
Go
33 lines
948 B
Go
package main
|
|
|
|
import (
|
|
i3 "go.i3wm.org/i3/v4"
|
|
)
|
|
|
|
// X11PIDResolver abstrait la lecture de _NET_WM_PID pour testabilite.
|
|
type X11PIDResolver interface {
|
|
GetPID(windowID int64) (int, error)
|
|
}
|
|
|
|
// I3TreeProvider abstrait i3.GetTree() pour testabilite.
|
|
type I3TreeProvider interface {
|
|
GetTree() (i3.Tree, error)
|
|
}
|
|
|
|
// ReadPPID lit le PPid depuis /proc/PID/status. procDir injectable pour les tests.
|
|
func ReadPPID(procDir string, pid int) (int, error) {
|
|
return 0, nil
|
|
}
|
|
|
|
// ResolveWorkspace remonte la chaine PPID depuis claudePID jusqu'a trouver
|
|
// un PID connu dans terminalWorkspaces. Max 20 niveaux.
|
|
func ResolveWorkspace(procDir string, claudePID int, terminalWorkspaces map[int]string) string {
|
|
return ""
|
|
}
|
|
|
|
// BuildTerminalWorkspaceMap construit la map terminalPID -> workspaceName.
|
|
// Utilise i3 GetTree + X11 _NET_WM_PID.
|
|
func BuildTerminalWorkspaceMap(tree I3TreeProvider, x11 X11PIDResolver) (map[int]string, error) {
|
|
return nil, nil
|
|
}
|