Adjust the prompt FS layout and test strategy
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user