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

Function TestState_SaveCreatesDirectory

apps/cli/internal/sync/state_test.go:88–108  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

86}
87
88func TestState_SaveCreatesDirectory(t *testing.T) {
89 dir := t.TempDir()
90
91 state := &SyncState{
92 Source: "jira",
93 Tasks: map[string]TaskState{},
94 }
95
96 if err := SaveState(dir, "jira", state); err != nil {
97 t.Fatalf("failed to save state: %v", err)
98 }
99
100 // Load should succeed
101 loaded, err := LoadState(dir, "jira")
102 if err != nil {
103 t.Fatalf("failed to load state: %v", err)
104 }
105 if loaded.Source != "jira" {
106 t.Errorf("expected source=jira, got %q", loaded.Source)
107 }
108}

Callers

nothing calls this directly

Calls 2

SaveStateFunction · 0.85
LoadStateFunction · 0.85

Tested by

no test coverage detected