test: expand compact and ui coverage

This commit is contained in:
Jordan Hubbard
2025-12-29 19:32:38 -04:00
committed by Steve Yegge
parent d3b6855aa9
commit c9fa7af04c
7 changed files with 639 additions and 30 deletions

View File

@@ -242,3 +242,20 @@ func TestResolveForWrite(t *testing.T) {
}
})
}
func TestFindMoleculesJSONLInDir(t *testing.T) {
root := t.TempDir()
molecules := filepath.Join(root, "molecules.jsonl")
if err := os.WriteFile(molecules, []byte("[]"), 0o644); err != nil {
t.Fatalf("failed to create molecules.jsonl: %v", err)
}
if got := FindMoleculesJSONLInDir(root); got != molecules {
t.Fatalf("expected %q, got %q", molecules, got)
}
otherDir := t.TempDir()
if got := FindMoleculesJSONLInDir(otherDir); got != "" {
t.Fatalf("expected empty path when file missing, got %q", got)
}
}