This commit is contained in:
2026-06-23 05:02:15 +08:00
commit e6f1776d4f
264 changed files with 54215 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package gitea_test
import (
"testing"
"superwork-tui/internal/gitea"
)
func TestNewNormalizesHost(t *testing.T) {
cases := []struct {
in string
want string
}{
{"gitea.example.cn", "https://gitea.example.cn"},
{"https://gitea.example.cn", "https://gitea.example.cn"},
{"https://gitea.example.cn/", "https://gitea.example.cn"},
{"http://localhost:3000", "http://localhost:3000"},
}
for _, c := range cases {
if got := gitea.New(c.in, "tok").Host; got != c.want {
t.Errorf("New(%q).Host = %q, want %q", c.in, got, c.want)
}
}
}