Fixing unit tests on windows (#813)
* Add Windows stub for orphan cleanup * Fix account switch tests on Windows * Make query session events test portable * Disable beads daemon in query session events test * Add Windows bd stubs for sling tests * Make expandOutputPath test OS-agnostic * Make role_agents test Windows-friendly * Make config path tests OS-agnostic * Make HealthCheckStateFile test OS-agnostic * Skip orphan process check on Windows * Normalize sparse checkout detail paths * Make dog path tests OS-agnostic * Fix bare repo refspec config on Windows * Add Windows process detection for locks * Add Windows CI workflow * Make mail path tests OS-agnostic * Skip plugin file mode test on Windows * Skip tmux-dependent polecat tests on Windows * Normalize polecat paths and AGENTS.md content * Make beads init failure test Windows-friendly * Skip rig agent bead init test on Windows * Make XDG path tests OS-agnostic * Make exec tests portable on Windows * Adjust atomic write tests for Windows * Make wisp tests Windows-friendly * Make workspace find tests OS-agnostic * Fix Windows rig add integration test * Make sling var logging Windows-friendly * Fix sling attached molecule update ordering --------- Co-authored-by: Johann Dirry <johann.dirry@microsea.at>
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
func TestNewMailbox(t *testing.T) {
|
||||
m := NewMailbox("/tmp/test")
|
||||
if m.path != "/tmp/test/inbox.jsonl" {
|
||||
if filepath.ToSlash(m.path) != "/tmp/test/inbox.jsonl" {
|
||||
t.Errorf("NewMailbox path = %q, want %q", m.path, "/tmp/test/inbox.jsonl")
|
||||
}
|
||||
if !m.legacy {
|
||||
@@ -332,7 +332,7 @@ func TestMailboxIdentityAndPath(t *testing.T) {
|
||||
if legacy.Identity() != "" {
|
||||
t.Errorf("Legacy mailbox identity = %q, want empty", legacy.Identity())
|
||||
}
|
||||
if legacy.Path() != "/tmp/test/inbox.jsonl" {
|
||||
if filepath.ToSlash(legacy.Path()) != "/tmp/test/inbox.jsonl" {
|
||||
t.Errorf("Legacy mailbox path = %q, want /tmp/test/inbox.jsonl", legacy.Path())
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ func TestNewMailboxWithBeadsDir(t *testing.T) {
|
||||
if m.identity != "gastown/Toast" {
|
||||
t.Errorf("identity = %q, want 'gastown/Toast'", m.identity)
|
||||
}
|
||||
if m.beadsDir != "/custom/.beads" {
|
||||
if filepath.ToSlash(m.beadsDir) != "/custom/.beads" {
|
||||
t.Errorf("beadsDir = %q, want '/custom/.beads'", m.beadsDir)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ func TestResolveBeadsDir(t *testing.T) {
|
||||
r := NewRouterWithTownRoot("/work/dir", "/home/user/gt")
|
||||
got := r.resolveBeadsDir("gastown/Toast")
|
||||
want := "/home/user/gt/.beads"
|
||||
if got != want {
|
||||
if filepath.ToSlash(got) != want {
|
||||
t.Errorf("resolveBeadsDir with townRoot = %q, want %q", got, want)
|
||||
}
|
||||
|
||||
@@ -206,17 +206,17 @@ func TestResolveBeadsDir(t *testing.T) {
|
||||
r2 := &Router{workDir: "/work/dir", townRoot: ""}
|
||||
got2 := r2.resolveBeadsDir("mayor/")
|
||||
want2 := "/work/dir/.beads"
|
||||
if got2 != want2 {
|
||||
if filepath.ToSlash(got2) != want2 {
|
||||
t.Errorf("resolveBeadsDir without townRoot = %q, want %q", got2, want2)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewRouterWithTownRoot(t *testing.T) {
|
||||
r := NewRouterWithTownRoot("/work/rig", "/home/gt")
|
||||
if r.workDir != "/work/rig" {
|
||||
if filepath.ToSlash(r.workDir) != "/work/rig" {
|
||||
t.Errorf("workDir = %q, want '/work/rig'", r.workDir)
|
||||
}
|
||||
if r.townRoot != "/home/gt" {
|
||||
if filepath.ToSlash(r.townRoot) != "/home/gt" {
|
||||
t.Errorf("townRoot = %q, want '/home/gt'", r.townRoot)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user