refactor(*): 稳定期治理 - 收敛核心架构、错误语义并修复跨项目数据竞态
This commit is contained in:
1 parent
bacd502f5c
commit
b5f3413ded
298 files changed
+12681
-26428
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package service
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestResourceIDFromFileURL(t *testing.T) {
|
||||
cases := []struct {
|
||||
in string
|
||||
want string
|
||||
}{
|
||||
{"/api/resources/abc_123/file", "abc_123"},
|
||||
{"https://host.example/api/resources/abc_123/file?proxy=1", "abc_123"},
|
||||
{"/api/projects/abc_123", ""},
|
||||
{"", ""},
|
||||
}
|
||||
for _, item := range cases {
|
||||
if got := resourceIDFromFileURL(item.in); got != item.want {
|
||||
t.Fatalf("resourceIDFromFileURL(%q) = %q, want %q", item.in, got, item.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user