MCPcopy Create free account
hub / github.com/gogs/gogs / TestIsUsernameAllowed

Function TestIsUsernameAllowed

internal/database/users_test.go:1165–1178  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1163}
1164
1165func TestIsUsernameAllowed(t *testing.T) {
1166 for name := range reservedUsernames {
1167 t.Run(name, func(t *testing.T) {
1168 assert.True(t, IsErrNameNotAllowed(isUsernameAllowed(name)))
1169 })
1170 }
1171
1172 for _, pattern := range reservedUsernamePatterns {
1173 t.Run(pattern, func(t *testing.T) {
1174 username := strings.ReplaceAll(pattern, "*", "alice")
1175 assert.True(t, IsErrNameNotAllowed(isUsernameAllowed(username)))
1176 })
1177 }
1178}
1179
1180func usersAddEmail(t *testing.T, ctx context.Context, s *UsersStore) {
1181 t.Run("multiple users can add the same unverified email", func(t *testing.T) {

Callers

nothing calls this directly

Calls 3

IsErrNameNotAllowedFunction · 0.85
isUsernameAllowedFunction · 0.85
ReplaceAllMethod · 0.80

Tested by

no test coverage detected