| 83 | } |
| 84 | |
| 85 | func TestNewLoop(t *testing.T) { |
| 86 | l := NewLoop("/path/to/prd.json", "test prompt", 5, testProvider) |
| 87 | |
| 88 | if l.prdPath != "/path/to/prd.json" { |
| 89 | t.Errorf("Expected prdPath %q, got %q", "/path/to/prd.json", l.prdPath) |
| 90 | } |
| 91 | if l.prompt != "test prompt" { |
| 92 | t.Errorf("Expected prompt %q, got %q", "test prompt", l.prompt) |
| 93 | } |
| 94 | if l.maxIter != 5 { |
| 95 | t.Errorf("Expected maxIter %d, got %d", 5, l.maxIter) |
| 96 | } |
| 97 | if l.events == nil { |
| 98 | t.Error("Expected events channel to be initialized") |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | func TestNewLoopWithWorkDir(t *testing.T) { |
| 103 | l := NewLoopWithWorkDir("/path/to/prd.json", "/work/dir", "test prompt", 5, testProvider) |