osaet/backend/internal/cli/config_test.go
yarnom f0b50d13ea feat: add admin publishing workflow and yar theme
Add Go/Postgres admin APIs, Angular admin UI, manual build flow, asset uploads, markdown import/export, configurable slug generation, and the Yar reading theme. Exclude local docs and generated development artifacts from version control.
2026-06-01 15:48:04 +08:00

27 lines
693 B
Go

package cli
import (
"strings"
"testing"
)
func TestRunConfigReportsLocalOnly(t *testing.T) {
err := runConfig(t.TempDir(), nil)
if err == nil || !strings.Contains(err.Error(), "local-file-only") {
t.Fatalf("expected local-file-only error, got %v", err)
}
err = runConfig(t.TempDir(), []string{"sync"})
if err == nil || !strings.Contains(err.Error(), "unsupported subcommand \"sync\"") {
t.Fatalf("expected unsupported subcommand error, got %v", err)
}
}
func TestParseTime(t *testing.T) {
if _, ok := parseTime("2026-05-28T12:00:00+08:00"); !ok {
t.Fatal("expected RFC3339 time to parse")
}
if _, ok := parseTime("not-time"); ok {
t.Fatal("expected invalid time")
}
}