MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestCmdDoWithResumeAppendsPositionalArg

Function TestCmdDoWithResumeAppendsPositionalArg

internal/app/do_test.go:1011–1035  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1009 if task.SessionID.String != newSID {
1010 t.Errorf("session_id after --force: got %q, want %s", task.SessionID.String, newSID)
1011 }
1012}
1013
1014// TestCmdDoHereIdempotent pins that re-running --here against a
1015// task already bound to THIS session is a no-op success (no error,
1016// no overwrite needed).
1017func TestCmdDoHereIdempotent(t *testing.T) {
1018 setupFlowRoot(t)
1019 seedTaskAtCwd(t, "idem-task")
1020 stubClaudeStatOK(t)
1021 const sid = "f00ba111-2222-4333-8444-555555555555"
1022 t.Setenv("CLAUDE_CODE_SESSION_ID", sid)
1023
1024 if rc := cmdDo([]string{"idem-task", "--here"}); rc != 0 {
1025 t.Fatalf("first --here rc=%d", rc)
1026 }
1027 if rc := cmdDo([]string{"idem-task", "--here"}); rc != 0 {
1028 t.Errorf("second --here rc=%d, want 0 (idempotent)", rc)
1029 }
1030}
1031
1032// TestCmdDoHereRejectsCurrentSessionAlreadyBoundElsewhere pins the
1033// no-duplicate-session_id invariant: if THIS session is already
1034// bound to another task, --here refuses with a friendly error
1035// regardless of --force. The session-id uniqueness is structural;
1036// no escape hatch.
1037func TestCmdDoHereRejectsCurrentSessionAlreadyBoundElsewhere(t *testing.T) {
1038 setupFlowRoot(t)

Callers

nothing calls this directly

Calls 6

NowISOFunction · 0.92
setupFlowRootFunction · 0.85
seedTaskFunction · 0.85
openFlowDBFunction · 0.85
stubITermFunction · 0.85
cmdDoFunction · 0.85

Tested by

no test coverage detected