require.ErrorContains(t, err, "set ONECHAT_DIR to a shorter path")
}
+func TestDaemonWritesNoFileForALongSocketPath(t *testing.T) {
+ dir := filepath.Join(t.TempDir(), strings.Repeat("d", 100))
+ t.Setenv("ONECHAT_DIR", dir)
+
+ err := daemon(t.Context(), io.Discard)
+ require.ErrorContains(t, err, "set ONECHAT_DIR to a shorter path")
+
+ entries, err := os.ReadDir(dir)
+ require.NoError(t, err)
+ require.Empty(t, entries)
+}
+
func TestOneProcessHoldsTheTokens(t *testing.T) {
dir := t.TempDir()
lock, err := lockTokens(dir)