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.
27 lines
693 B
Go
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")
|
|
}
|
|
}
|