mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-11 17:26:57 +02:00
- suppression des migrations d'agencement, d'unites et de dossier de donnees - store bbolt unique (ajean.db) : config, prefs, conversation, cles, drapeaux - arborescence backends/ bin/ presets/ memory/ models/ workspace/ - plus aucune variable, unite ou asset nomme jean
36 lines
1.0 KiB
Go
36 lines
1.0 KiB
Go
package ajean
|
|
|
|
import (
|
|
"path/filepath"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
// Un chemin relatif du modèle doit atterrir dans le workspace, jamais dans le
|
|
// répertoire courant du processus (Bureau, C:\ProgramData\ajean\bin…).
|
|
func TestResolveAgentPathRelative(t *testing.T) {
|
|
got := resolveAgentPath("meteo.json")
|
|
want := filepath.Join(agentWorkspace(), "meteo.json")
|
|
if got != want {
|
|
t.Fatalf("resolveAgentPath = %q, attendu %q", got, want)
|
|
}
|
|
}
|
|
|
|
// Un chemin absolu demandé explicitement reste intouché.
|
|
func TestResolveAgentPathAbsolute(t *testing.T) {
|
|
abs := filepath.Join(t.TempDir(), "rapport.md")
|
|
if got := resolveAgentPath(abs); got != abs {
|
|
t.Fatalf("resolveAgentPath = %q, attendu %q", got, abs)
|
|
}
|
|
}
|
|
|
|
func TestResolveAgentPathSubdir(t *testing.T) {
|
|
got := resolveAgentPath("notes/2026/a.txt")
|
|
if !strings.HasPrefix(got, agentWorkspace()) {
|
|
t.Fatalf("%q hors du workspace %q", got, agentWorkspace())
|
|
}
|
|
if strings.Contains(got, "/") && filepath.Separator != '/' {
|
|
t.Fatalf("séparateurs non normalisés : %q", got)
|
|
}
|
|
}
|