Why: Allow consumers to download an immutable module revision without nested source checkouts or local path replacements. Evidence: SELF package tests and the prior canonical-path rejection are recorded in the Dev dependency-workspace task card; remote consumption is replayed against the committed candidate. Impact: Change the module identity and its Go imports while preserving API behavior. Existing historical submodule revisions remain buildable. Refs: Versioned dependencies U1/U3; feature/dependency-workspace
28 lines
648 B
Go
28 lines
648 B
Go
package runmgr
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
"testing"
|
|
"time"
|
|
|
|
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
|
|
)
|
|
|
|
func TestWaitHITLTimeout(t *testing.T) {
|
|
ch := make(chan hitlAnswer)
|
|
_, err := waitHITL(context.Background(), ch, 20*time.Millisecond)
|
|
if err == nil || !strings.Contains(err.Error(), "timed out") {
|
|
t.Fatalf("got %v", err)
|
|
}
|
|
}
|
|
|
|
func TestWaitHITLAnswer(t *testing.T) {
|
|
ch := make(chan hitlAnswer, 1)
|
|
ch <- hitlAnswer{resp: core.HITLResponse{ChoiceID: "ok"}}
|
|
resp, err := waitHITL(context.Background(), ch, time.Second)
|
|
if err != nil || resp.ChoiceID != "ok" {
|
|
t.Fatalf("resp=%+v err=%v", resp, err)
|
|
}
|
|
}
|