Files
interzone/internal/ui/diff_test.go
T
vvvomitandClaude Opus 5.5 0350eec80e Live logs, cached views, Manage shortcuts, Review diff, header health
- View logs follows journalctl -f until esc instead of fetching 300 lines.
- Dashboard, Users and the logs' service list show what they loaded last
  time (cached per server) and refresh in the background.
- Every Manage action has a one-letter shortcut; actions that change the
  server right away need the letter twice.
- Review shows what changes in vars.yml since the last successful deploy;
  x switches to the whole file.
- The header shows whether matrix.<domain> answers over HTTPS and how many
  days its certificate has left, checked every minute from this machine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 23:29:21 +03:30

21 lines
470 B
Go

package ui
import (
"strings"
"testing"
)
func TestLineDiff(t *testing.T) {
d := lineDiff(strings.Split("a\nb\nc\nd", "\n"), strings.Split("a\nx\nc\nd\ne", "\n"))
var got []string
for _, l := range d {
got = append(got, string(l.op)+l.text)
}
if want := " a,-b,+x, c, d,+e"; strings.Join(got, ",") != want {
t.Fatalf("got %s, want %s", strings.Join(got, ","), want)
}
if a, r := diffChanges(d); a != 2 || r != 1 {
t.Fatalf("changes %d+ %d-", a, r)
}
}