Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142// Name selection for the default home depends on the user's home directory,// which E2E cannot vary without a second user. This test checks that the stable// declarative name is paired only with the default home.package loginservice
import ( "path/filepath" "runtime" "testing")
func TestDeclarativeRegistrationOnlyAppliesToDefaultHome(t *testing.T) { if runtime.GOOS != "linux" && runtime.GOOS != "darwin" { t.Skip("native user services require Linux or macOS") } userHome := t.TempDir() t.Setenv("HOME", userHome) owned, err := ForDaemon(filepath.Join(userHome, ".albedo")) if err != nil { t.Fatal(err) } declared, ok := owned.companion() want := "albedo.service" if runtime.GOOS == "darwin" { want = "systems.albedo.daemon" } if !ok || declared.Name() != want || !declared.declarative { t.Fatalf("default registration: %+v", declared) } reverse, ok := declared.companion() if !ok || reverse.Name() != owned.Name() || reverse.Path() != owned.Path() { t.Fatal("companion did not preserve CLI registration") } custom, err := ForDaemon(filepath.Join(userHome, "another-home")) if err != nil { t.Fatal(err) } if _, ok = custom.companion(); ok { t.Fatal("default declaration claimed a custom home") }}