package app import ( "testing" "time" ) func TestFormatLastHeartbeat(t *testing.T) { if got := formatLastHeartbeat(time.Time{}); got != "unknown" { t.Fatalf("zero time = %q, want unknown", got) } beat := time.Date(2026, 1, 2, 3, 4, 5, 0, time.Local) if got := formatLastHeartbeat(beat); got != "2026-01-02 03:04:05" { t.Fatalf("formatLastHeartbeat = %q", got) } } func TestShellQuote(t *testing.T) { tests := map[string]string{ "https://s3.example.com:8333/s3": "https://s3.example.com:8333/s3", "https://proxy.example.com/s3;v1": "'https://proxy.example.com/s3;v1'", "https://example.com/a b": "'https://example.com/a b'", "https://example.com/it's": `'https://example.com/it'\''s'`, "": "''", } for in, want := range tests { if got := shellQuote(in); got != want { t.Errorf("shellQuote(%q) = %q, want %q", in, got, want) } } }