mirror of
https://github.com/theniceboy/.config.git
synced 2026-05-11 17:36:05 +08:00
agent tracker + tmux update
This commit is contained in:
parent
cd9c92b1c2
commit
5064629d61
68 changed files with 15041 additions and 3483 deletions
32
agent-tracker/cmd/agent/create_window_test.go
Normal file
32
agent-tracker/cmd/agent/create_window_test.go
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPreferredNewWindowTarget(t *testing.T) {
|
||||
if got := preferredNewWindowTarget("@9", true, "@3"); got != "@9" {
|
||||
t.Fatalf("expected explicit target window, got %q", got)
|
||||
}
|
||||
if got := preferredNewWindowTarget("", true, "@3"); got != "@3" {
|
||||
t.Fatalf("expected current tmux window fallback, got %q", got)
|
||||
}
|
||||
if got := preferredNewWindowTarget("", false, "@3"); got != "" {
|
||||
t.Fatalf("expected no target outside tmux, got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPositionedNewWindowArgs(t *testing.T) {
|
||||
got := positionedNewWindowArgs("feature-x", "/tmp/repo", "@7")
|
||||
want := []string{"new-window", "-P", "-F", "#{window_id}", "-a", "-t", "@7", "-n", "feature-x", "-c", "/tmp/repo"}
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
t.Fatalf("expected positioned new-window args %v, got %v", want, got)
|
||||
}
|
||||
|
||||
got = positionedNewWindowArgs("feature-x", "/tmp/repo", "")
|
||||
want = []string{"new-window", "-P", "-F", "#{window_id}", "-n", "feature-x", "-c", "/tmp/repo"}
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
t.Fatalf("expected default new-window args %v, got %v", want, got)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue