TestCmdUpdateTaskBothFields exercises combining multiple field- changing flags in one call.
(t *testing.T)
| 143 | // TestCmdUpdateTaskBothFields exercises combining multiple field- |
| 144 | // changing flags in one call. |
| 145 | func TestCmdUpdateTaskBothFields(t *testing.T) { |
| 146 | setupFlowRoot(t) |
| 147 | seedTask(t, "ut-both") |
| 148 | |
| 149 | newDir := filepath.Join(t.TempDir(), "combo") |
| 150 | if rc := cmdUpdate([]string{"task", "ut-both", |
| 151 | "--priority", "high", "--work-dir", newDir, "--mkdir"}); rc != 0 { |
| 152 | t.Fatalf("rc=%d", rc) |
| 153 | } |
| 154 | db := openFlowDB(t) |
| 155 | task, _ := flowdb.GetTask(db, "ut-both") |
| 156 | if task.Priority != "high" { |
| 157 | t.Errorf("priority = %q, want high", task.Priority) |
| 158 | } |
| 159 | if task.WorkDir != newDir { |
| 160 | t.Errorf("work_dir = %q, want %q", task.WorkDir, newDir) |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | func TestCmdUpdateTaskRequiresFlag(t *testing.T) { |
| 165 | setupFlowRoot(t) |
nothing calls this directly
no test coverage detected