Improve command execution modes

This commit is contained in:
mixeme
2026-06-18 00:13:12 +03:00
parent eb6a1907e6
commit 975829ed70
10 changed files with 600 additions and 51 deletions
+25
View File
@@ -1,6 +1,7 @@
package core
import (
"strings"
"testing"
"time"
)
@@ -27,3 +28,27 @@ func TestNextRunTimeSupportsCron(t *testing.T) {
t.Fatalf("expected %s, got %s", want, next)
}
}
func TestRunningOutputIncludesInvocation(t *testing.T) {
started := time.Date(2026, 6, 17, 23, 40, 0, 0, time.Local)
job := Job{
Name: "Backup",
Command: `C:\Program Files\FreeFileSync\FreeFileSync.exe`,
Arguments: `D:\Local\Jobs\Auto.ffs_batch`,
SuccessExitCodes: "0,1",
}
output := runningOutput(job, "Manual", started)
for _, want := range []string{
"Running since 2026-06-17 23:40:00",
"Manual",
job.Command,
job.Arguments,
"0,1",
"start_only",
} {
if !strings.Contains(output, want) {
t.Fatalf("expected running output to contain %q, got:\n%s", want, output)
}
}
}