mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-11 17:26:57 +02:00
v0.8.9 : piloter un autre PC depuis l'IA (poste distant ajean-remote)
This commit is contained in:
1 parent
6d36464971
commit
7fa5461136
27 files changed
+2432
-49
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package nodeclient
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Un chemin ENTRE GUILLEMETS doit fonctionner (régression : Go ré-échappait les
|
||||
// guillemets et cmd renvoyait « syntaxe du nom de fichier incorrecte »).
|
||||
func TestRunShellQuotedPath(t *testing.T) {
|
||||
out := runShell(context.Background(), `dir "C:\Windows" /b`, 10, "")
|
||||
if !strings.Contains(out, "exit: 0") {
|
||||
t.Fatalf("commande avec chemin entre guillemets a échoué:\n%s", out)
|
||||
}
|
||||
if !strings.Contains(strings.ToLower(out), "system32") {
|
||||
t.Fatalf("sortie inattendue (System32 absent):\n%s", out)
|
||||
}
|
||||
// La sortie doit être de l'UTF-8 propre : pas de caractère de remplacement
|
||||
// U+FFFD (le « � » qui apparaissait avec la codepage OEM).
|
||||
if strings.ContainsRune(out, '\uFFFD') {
|
||||
t.Fatalf("la sortie contient des caractères mal encodés (�):\n%s", out)
|
||||
}
|
||||
}
|
||||
|
||||
// L'accent de « Répertoire » doit être correct (validation de chcp 65001).
|
||||
func TestRunShellUTF8Accents(t *testing.T) {
|
||||
out := runShell(context.Background(), `dir C:\Windows`, 10, "")
|
||||
if strings.ContainsRune(out, '\uFFFD') {
|
||||
t.Fatalf("caractères mal encodés dans la sortie:\n%s", out)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user