test(02-02): add failing tests for PPID chain walk + workspace resolution
- TestReadPPID, TestReadPPIDMissing - TestResolveWorkspace, TestResolveWorkspaceNotFound, TestResolveWorkspaceMaxDepth - TestBuildTerminalWorkspaceMapUnit - Add go.i3wm.org/i3/v4 dependency
This commit is contained in:
32
workspace.go
Normal file
32
workspace.go
Normal file
@@ -0,0 +1,32 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user