feat(server-go): 分子检测扩展(qPCR Ct 判读/SERS 光谱上传/光谱库,#19)

This commit is contained in:
weijuesen
2026-08-12 19:33:05 +08:00
parent afb1df6f10
commit 7bb87dd89c
7 changed files with 323 additions and 0 deletions
@@ -77,3 +77,16 @@ func TestBuildObjectKeyPrefix(t *testing.T) {
t.Errorf("key/ext 应以 .jpg 结尾: %s / %s", key, ext)
}
}
func TestBuildDataKey(t *testing.T) {
key, ext, err := buildDataKey("spectrum", "a.CSV")
if err != nil {
t.Fatalf("buildDataKey 失败: %v", err)
}
if !strings.HasPrefix(key, "spectrum/") || !strings.HasSuffix(key, ".csv") {
t.Errorf("key 不正确: %s", key)
}
if ext != ".csv" {
t.Errorf("ext = %s, want .csv", ext)
}
}