Files
gitea-mcp/operation/actions/logs_test.go
Ivan Loginov 440547e9c1
Some checks failed
release-nightly / release-image (push) Has been cancelled
first commit
2026-06-05 14:58:55 +03:00

23 lines
474 B
Go

package actions
import "testing"
func TestTailByLines(t *testing.T) {
in := []byte("a\nb\nc\nd\n")
got := string(tailByLines(in, 2))
if got != "c\nd\n" {
t.Fatalf("tailByLines(...,2) = %q", got)
}
}
func TestLimitBytesKeepsTail(t *testing.T) {
in := []byte("0123456789")
out, truncated := limitBytes(in, 4)
if !truncated {
t.Fatalf("expected truncated=true")
}
if string(out) != "6789" {
t.Fatalf("limitBytes tail = %q, want %q", string(out), "6789")
}
}