MCPcopy Create free account
hub / github.com/driangle/taskmd / TestParseIDConfig_FullConfig

Function TestParseIDConfig_FullConfig

apps/cli/internal/cli/validate_test.go:751–776  ·  view source on GitHub ↗

--- parseIDConfig tests ---

(t *testing.T)

Source from the content-addressed store, hash-verified

749// --- parseIDConfig tests ---
750
751func TestParseIDConfig_FullConfig(t *testing.T) {
752 raw := map[string]any{
753 "strategy": "prefixed",
754 "prefix": "dr",
755 "length": 6,
756 "padding": 3,
757 }
758
759 cfg := parseIDConfig(raw)
760 if cfg == nil {
761 t.Fatal("expected non-nil IDConfig")
762 return
763 }
764 if cfg.Strategy != "prefixed" {
765 t.Errorf("Strategy = %q, want %q", cfg.Strategy, "prefixed")
766 }
767 if cfg.Prefix != "dr" {
768 t.Errorf("Prefix = %q, want %q", cfg.Prefix, "dr")
769 }
770 if cfg.Length != 6 {
771 t.Errorf("Length = %d, want 6", cfg.Length)
772 }
773 if cfg.Padding != 3 {
774 t.Errorf("Padding = %d, want 3", cfg.Padding)
775 }
776}
777
778func TestParseIDConfig_PartialConfig(t *testing.T) {
779 raw := map[string]any{

Callers

nothing calls this directly

Calls 1

parseIDConfigFunction · 0.85

Tested by

no test coverage detected