claude-web-chat/markdown_test.go
djuka adea7ca28d
Some checks failed
Tests / unit-tests (push) Failing after 43s
Zamena chat UI sa pravim terminalom (xterm.js + PTY)
- Dodat creack/pty za pseudo-terminal podršku
- Claude CLI se pokreće u pravom PTY-ju (puni TUI, boje, Shift+Tab)
- xterm.js u browseru renderuje terminal identično konzoli
- WebSocket bridge: tastatura → PTY stdin, PTY stdout → terminal
- Ring buffer (128KB) za replay pri reconnect-u
- Automatski reconnect nakon 2 sekunde
- PTY sesije žive nezavisno od browsera (60min idle timeout)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 05:54:40 +00:00

31 lines
721 B
Go

package main
import (
"strings"
"testing"
)
func TestRenderMD(t *testing.T) {
tests := []struct {
name string
input string
contains string
}{
{"plain text", "Hello world", "<p>Hello world</p>"},
{"bold", "**bold**", "<strong>bold</strong>"},
{"code block", "```\ncode\n```", "<code>code"},
{"inline code", "`inline`", "<code>inline</code>"},
{"heading", "# Title", "<h1>Title</h1>"},
{"table", "| A | B |\n|---|---|\n| 1 | 2 |", "<table>"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := RenderMD(tt.input)
if !strings.Contains(result, tt.contains) {
t.Errorf("RenderMD(%q) = %q, want to contain %q", tt.input, result, tt.contains)
}
})
}
}