Introduce a commercial license option alongside AGPL-3.0-only, require a CLA for contributors, and document the terms in COMMERCIAL.md and NOTICE. Add a script to stamp SPDX headers on Go files and apply it across the tree.
22 lines
610 B
Go
22 lines
610 B
Go
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
// SPDX-FileCopyrightText: 2025-2026 Christian Galo
|
|
|
|
package provisioning
|
|
|
|
import "testing"
|
|
|
|
func TestDisplayNameFromClaims(t *testing.T) {
|
|
cases := []struct{ name, preferred, want string }{
|
|
{"Alice Admin", "alice", "Alice Admin"},
|
|
{"", "alice", "alice"},
|
|
{" ", "alice", "alice"},
|
|
{"", "", ""},
|
|
{" Bob ", "", "Bob"},
|
|
}
|
|
for _, tc := range cases {
|
|
if got := DisplayNameFromClaims(tc.name, tc.preferred); got != tc.want {
|
|
t.Errorf("DisplayNameFromClaims(%q, %q) = %q, want %q", tc.name, tc.preferred, got, tc.want)
|
|
}
|
|
}
|
|
}
|