test(02-02): add failing tests for fuzzy match + switch workspace

- TestFuzzyMatchByLabel, TestFuzzyMatchByBranch, TestFuzzyMatchByCwd
- TestFuzzyMatchPriority (label wins over branch)
- TestFuzzyMatchNoResult, TestFuzzyMatchCaseInsensitive
- TestSwitchToWorkspace, TestSwitchToWorkspaceError, TestSwitchToWorkspaceI3Error
This commit is contained in:
Pierre Martin
2026-03-23 17:44:56 +01:00
parent a2fb37e2b5
commit 4a298d5ad0
2 changed files with 168 additions and 0 deletions

21
i3bridge.go Normal file
View File

@@ -0,0 +1,21 @@
package main
import (
i3 "go.i3wm.org/i3/v4"
)
// I3Commander abstrait i3.RunCommand pour testabilite.
type I3Commander interface {
RunCommand(command string) ([]i3.CommandResult, error)
}
// FuzzyMatch trouve la premiere session matchant query dans : label > branche > cwd.
// Case-insensitive. Retourne nil si aucun match.
func FuzzyMatch(query string, sessions []SessionInfo) *SessionInfo {
return nil
}
// SwitchToWorkspace bascule vers le workspace indique via i3 IPC.
func SwitchToWorkspace(commander I3Commander, wsName string) error {
return nil
}