mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-28 01:06:50 +09:00
Open PR with commits by others: rebase onto base, build on top, push with lease. Rebase conflict pauses and comments once.
28 lines
712 B
Go
28 lines
712 B
Go
package main
|
|
|
|
import (
|
|
"slices"
|
|
"testing"
|
|
)
|
|
|
|
// The bot's own commits are rebuilt every run; only someone else's are carried.
|
|
func TestNotAuthoredBy(t *testing.T) {
|
|
const bot = "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
log := bot + "\x00flake.lock: update nixpkgs\n" +
|
|
"dev@example.com\x00noise: fix deprecation\n" +
|
|
bot + "\x00go.mod: update dependencies\n" +
|
|
"dev@example.com\x00capver: regenerate\n"
|
|
|
|
got := notAuthoredBy(log, bot)
|
|
|
|
want := []string{"noise: fix deprecation", "capver: regenerate"}
|
|
if !slices.Equal(got, want) {
|
|
t.Errorf("notAuthoredBy = %q, want %q", got, want)
|
|
}
|
|
|
|
if got := notAuthoredBy("", bot); len(got) != 0 {
|
|
t.Errorf("empty log carried %q", got)
|
|
}
|
|
}
|