(t *testing.T)
| 106 | } |
| 107 | |
| 108 | func TestManagerGetState(t *testing.T) { |
| 109 | tmpDir := t.TempDir() |
| 110 | prdPath := createTestPRDWithName(t, tmpDir, "test-prd") |
| 111 | |
| 112 | m := NewManager(10, testProvider) |
| 113 | m.Register("test-prd", prdPath) |
| 114 | |
| 115 | state, iteration, err := m.GetState("test-prd") |
| 116 | if err != nil { |
| 117 | t.Fatalf("unexpected error: %v", err) |
| 118 | } |
| 119 | if state != LoopStateReady { |
| 120 | t.Errorf("expected Ready state, got %v", state) |
| 121 | } |
| 122 | if iteration != 0 { |
| 123 | t.Errorf("expected iteration 0, got %d", iteration) |
| 124 | } |
| 125 | |
| 126 | // Non-existent PRD |
| 127 | _, _, err = m.GetState("non-existent") |
| 128 | if err == nil { |
| 129 | t.Error("expected error for non-existent PRD") |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | func TestManagerGetAllInstances(t *testing.T) { |
| 134 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected