Files
sshtermy/internal/termemu/term_test.go
T
Claude db99520c08 sshTermy 1.0: SSH-Terminal mit KI-Copilot
Verbindungs-Manager mit verschlüsseltem Store (AES-256-GCM, Argon2id, DPAPI),
SSH-Terminal (x/vt), Tunnel -L/-R/-D und Web-Services, KI-Copilot für
OpenAI-kompatible Endpunkte (Ghost-Text, Folgebefehle, Ziel-Modus, Frage)
mit festen Gefahrenregeln, Versionierung und signiertes Auto-Update.

Idee: Dominik Bornhäußer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018i4GUgYsYk78PSL5QZPeim
2026-11-05 08:11:50 +00:00

26 lines
618 B
Go

package termemu
import (
"io"
"strings"
"testing"
)
func TestTypedInputAndGhost(t *testing.T) {
tm := New(60, 5, io.Discard)
defer tm.Close()
tm.Write([]byte("\x1b[1;32mdominik@spark\x1b[0m:~$ docker p"))
typed, ok := tm.TypedInput()
if !ok || typed != "docker p" {
t.Fatalf("TypedInput = %q %v", typed, ok)
}
v := tm.View("s -a", func(s string) string { return "[" + s + "]" })
if !strings.Contains(v, "docker p[s -a]") {
t.Fatalf("Ghost fehlt: %q", strings.Split(v, "\n")[0])
}
tm.Write([]byte("\r\nzeile 2\r\n"))
if !strings.Contains(tm.PlainLines(10), "zeile 2") {
t.Fatal("PlainLines")
}
}