agentbbs/cmd/agentbbs/provision_test.go
RissRIce 03a2ce3f8b
Some checks are pending
CI / build (push) Waiting to run
deploy / deploy (push) Waiting to run
test / test (push) Waiting to run
fix: validate provisioned account kind (#112)
2026-08-10 20:18:44 -07:00

28 lines
624 B
Go

package main
import (
"testing"
"github.com/profullstack/agentbbs/internal/auth"
)
func TestParseProvisionKind(t *testing.T) {
tests := []struct {
input string
want auth.Kind
ok bool
}{
{input: "member", want: auth.Member, ok: true},
{input: " Agent ", want: auth.Agent, ok: true},
{input: "guest", ok: false},
{input: "admin", ok: false},
{input: "", ok: false},
}
for _, test := range tests {
got, ok := parseProvisionKind(test.input)
if got != test.want || ok != test.ok {
t.Errorf("parseProvisionKind(%q) = (%q, %t), want (%q, %t)", test.input, got, ok, test.want, test.ok)
}
}
}