mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 18:58:38 +00:00
Fix unittest and repo create bug (#33061)
1. `StatDir` was not right, fix the FIXME 2. Clarify the test cases for `IsUsableRepoName` 3. Fix regression bug in `repo-new.ts` Fix #33060
This commit is contained in:
@@ -217,3 +217,15 @@ func TestComposeSSHCloneURL(t *testing.T) {
|
||||
setting.SSH.Port = 123
|
||||
assert.Equal(t, "ssh://git@[::1]:123/user/repo.git", ComposeSSHCloneURL("user", "repo"))
|
||||
}
|
||||
|
||||
func TestIsUsableRepoName(t *testing.T) {
|
||||
assert.NoError(t, IsUsableRepoName("a"))
|
||||
assert.NoError(t, IsUsableRepoName("-1_."))
|
||||
assert.NoError(t, IsUsableRepoName(".profile"))
|
||||
|
||||
assert.Error(t, IsUsableRepoName("-"))
|
||||
assert.Error(t, IsUsableRepoName("🌞"))
|
||||
assert.Error(t, IsUsableRepoName("the..repo"))
|
||||
assert.Error(t, IsUsableRepoName("foo.wiki"))
|
||||
assert.Error(t, IsUsableRepoName("foo.git"))
|
||||
}
|
||||
|
Reference in New Issue
Block a user