TestCmdDoHereRejectsDoneTask pins that --here on a done task refuses with a friendly pointer at the reopen path. Auto-reopen would silently bypass the user's previous closure intent.
(t *testing.T)
| 961 | db := openFlowDB(t) |
| 962 | if _, err := db.Exec( |
| 963 | `UPDATE tasks SET session_id=?, session_started=?, status='in-progress' WHERE slug='bound-task'`, |
| 964 | oldSID, flowdb.NowISO(), |
| 965 | ); err != nil { |
| 966 | t.Fatal(err) |
| 967 | } |
| 968 | db.Close() |
| 969 | |
| 970 | t.Setenv("CLAUDE_CODE_SESSION_ID", newSID) |
| 971 | if rc := cmdDo([]string{"bound-task", "--here"}); rc != 1 { |
| 972 | t.Errorf("rc=%d, want 1 when target already bound to a different session", rc) |
| 973 | } |
| 974 | |
| 975 | db = openFlowDB(t) |
| 976 | task, _ := flowdb.GetTask(db, "bound-task") |
| 977 | if task.SessionID.String != oldSID { |
| 978 | t.Errorf("session_id changed without --force: got %q, want %s", task.SessionID.String, oldSID) |
| 979 | } |
| 980 | } |
| 981 | |
| 982 | // TestCmdDoHereForceOverwritesBinding pins that --force allows the |
| 983 | // overwrite of a prior binding. The user has been told this orphans |
| 984 | // the prior session. |
nothing calls this directly
no test coverage detected