SHA256
1
0
forked from adamm/autogits
Files
autogits/common/reviewers_test.go
Jan Zerebecki 4604aaeeba Rename bots-common to common
to make it match the name it is imported as
2025-04-03 22:38:28 +02:00

39 lines
783 B
Go

package common_test
import (
"slices"
"testing"
"src.opensuse.org/autogits/common"
)
func TestReviewers(t *testing.T) {
tests := []struct {
name string
input []string
prj []string
pkg []string
}{
{
name: "project and package reviewers",
input: []string{"1", "2", "3", "*5", "+6", "-7"},
prj: []string{"5", "7", common.Bot_BuildReview},
pkg: []string{"1", "2", "3", "5", "6"},
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
reviewers := common.ParseReviewers(test.input)
if !slices.Equal(reviewers.Prj, test.prj) {
t.Error("unexpected return of ForProject():", reviewers.Prj)
}
if !slices.Equal(reviewers.Pkg, test.pkg) {
t.Error("unexpected return of ForProject():", reviewers.Pkg)
}
})
}
}