完成一个简易的全局skill、command管理器
This commit is contained in:
24
manager/internal/repo/git_test.go
Normal file
24
manager/internal/repo/git_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package repo
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestURLToPathName(t *testing.T) {
|
||||
tests := []struct {
|
||||
url string
|
||||
expected string
|
||||
}{
|
||||
{"https://github.com/user/repo.git", "github.com_user_repo"},
|
||||
{"https://github.com/user/repo", "github.com_user_repo"},
|
||||
{"http://gitlab.com/org/project.git", "gitlab.com_org_project"},
|
||||
{"https://github.com/user/my-repo.git", "github.com_user_my-repo"},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
result := URLToPathName(tc.url)
|
||||
if result != tc.expected {
|
||||
t.Errorf("URLToPathName(%s): 期望 %s,得到 %s", tc.url, tc.expected, result)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user