chore: import clean Agent Desk snapshot (2/7)
This commit is contained in:
36
internal/ai/runtime/instruction/assembler_test.go
Normal file
36
internal/ai/runtime/instruction/assembler_test.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package instruction
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAssemblerRespectsProvidedSources(t *testing.T) {
|
||||
result := NewAssembler().Assemble(AssemblerInput{
|
||||
AgentInstruction: "agent-rule",
|
||||
SkillInstruction: "skill-rule",
|
||||
ToolAppendices: []string{"tool-rule-1", "tool-rule-2"},
|
||||
})
|
||||
if !strings.Contains(result.Text, "Agent Rules:\nagent-rule") {
|
||||
t.Fatalf("missing agent instruction: %s", result.Text)
|
||||
}
|
||||
if !strings.Contains(result.Text, "Current Skill Context:\nskill-rule") {
|
||||
t.Fatalf("missing skill instruction: %s", result.Text)
|
||||
}
|
||||
if !strings.Contains(result.Text, "Tool Supplementary Rules:\ntool-rule-1") {
|
||||
t.Fatalf("missing tool appendix: %s", result.Text)
|
||||
}
|
||||
if !result.Summary.HasAgentRule || !result.Summary.HasSkillRule || !result.Summary.HasToolRule {
|
||||
t.Fatalf("unexpected summary: %#v", result.Summary)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAssemblerReturnsEmptyTextWhenInputIsEmpty(t *testing.T) {
|
||||
result := NewAssembler().Assemble(AssemblerInput{})
|
||||
if result.Text != "" {
|
||||
t.Fatalf("expected empty assembled text, got: %s", result.Text)
|
||||
}
|
||||
if len(result.Summary.SectionTitles) != 0 || result.Summary.HasAgentRule || result.Summary.HasSkillRule || result.Summary.HasToolRule {
|
||||
t.Fatalf("expected empty summary, got %#v", result.Summary)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user