Combines three repositories into a single workspace: - go-agent → pkg/orchestrator (Clotho), pkg/jobrunner, pkg/loop, cmd/ - go-agentic → pkg/lifecycle (allowance, sessions, plans, dispatch) - php-devops → repos.yaml, setup.sh, scripts/, .core/ Module path: forge.lthn.ai/core/agent All packages build, all tests pass. Co-Authored-By: Virgil <virgil@lethean.io>
26 lines
826 B
Go
26 lines
826 B
Go
package lifecycle
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestPrompt_Good_CommitExists(t *testing.T) {
|
|
content := Prompt("commit")
|
|
assert.NotEmpty(t, content, "commit prompt should exist")
|
|
assert.Contains(t, content, "Commit")
|
|
}
|
|
|
|
func TestPrompt_Bad_NonexistentReturnsEmpty(t *testing.T) {
|
|
content := Prompt("nonexistent-prompt-that-does-not-exist")
|
|
assert.Empty(t, content, "nonexistent prompt should return empty string")
|
|
}
|
|
|
|
func TestPrompt_Good_ContentIsTrimmed(t *testing.T) {
|
|
content := Prompt("commit")
|
|
// Should not start or end with whitespace.
|
|
assert.Equal(t, content[0:1] != " " && content[0:1] != "\n", true, "should not start with whitespace")
|
|
lastChar := content[len(content)-1:]
|
|
assert.Equal(t, lastChar != " " && lastChar != "\n", true, "should not end with whitespace")
|
|
}
|