Adjust the prompt FS layout and test strategy

This commit is contained in:
2026-07-06 11:26:21 -05:00
parent 8cafa64174
commit 47cf7e76ec
20 changed files with 266 additions and 111 deletions

View File

@@ -20,18 +20,21 @@ func TestModulePromptFSCombinesModuleAndSharedPrompts(t *testing.T) {
}
tests := map[string]string{
"assets/prompts/dnd.test/dnd.test.yaml": "id: dnd.test",
"assets/prompts/dnd.test/task.md": "task",
"assets/prompts/dnd.test/common-dnd-system.md": "You work with Dungeons & Dragons gameplay transcripts.",
"assets/prompts/dnd.test/common-dnd-transcript.md": "{{ input \"transcript\" }}",
"assets/prompts/dnd.test/common-dnd-references.md": "Roster reference:",
"assets/prompts/dnd.test/dnd.test.yaml": "id: dnd.test",
"assets/prompts/dnd.test/task.md": "task",
"assets/prompts/dnd.test/sharedassets/common-dnd-system.md": "",
"assets/prompts/dnd.test/sharedassets/common-dnd-transcript.md": "",
"assets/prompts/dnd.test/sharedassets/common-dnd-references.md": "",
}
for path, want := range tests {
data, err := fs.ReadFile(fsys, path)
if err != nil {
t.Fatalf("ReadFile(%q) error = %v, want nil", path, err)
}
if !strings.Contains(string(data), want) {
if len(data) == 0 {
t.Fatalf("ReadFile(%q) returned empty content", path)
}
if want != "" && !strings.Contains(string(data), want) {
t.Fatalf("ReadFile(%q) = %q, want substring %q", path, data, want)
}
}