revert fix(agentic): harden TODO workspace write Co-Authored-By: Virgil <virgil@lethean.io>
33 lines
662 B
Go
33 lines
662 B
Go
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
package agentic
|
|
|
|
import (
|
|
"testing"
|
|
|
|
core "dappco.re/go/core"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestEvents_EmitEvent_Good(t *testing.T) {
|
|
root := t.TempDir()
|
|
setTestWorkspace(t, root)
|
|
fs.EnsureDir(core.JoinPath(root, "workspace"))
|
|
|
|
assert.NotPanics(t, func() {
|
|
emitStartEvent("codex", "ws-1")
|
|
})
|
|
}
|
|
|
|
func TestEvents_EmitEvent_Bad_NoWorkspace(t *testing.T) {
|
|
setTestWorkspace(t, "/nonexistent")
|
|
assert.NotPanics(t, func() {
|
|
emitCompletionEvent("codex", "ws-1", "completed")
|
|
})
|
|
}
|
|
|
|
func TestEvents_EmitEvent_Ugly_AllEmpty(t *testing.T) {
|
|
assert.NotPanics(t, func() {
|
|
emitEvent("", "", "", "")
|
|
})
|
|
}
|