feat: 修复 AI 风险语义并隔离 Mock 数据
This commit is contained in:
@@ -13,6 +13,7 @@ func TestCrossValidate(t *testing.T) {
|
||||
{"AI健康+LAMP阴性 一致", "healthy", "negative", true},
|
||||
{"AI异常+LAMP阴性 不一致", "sick", "negative", false},
|
||||
{"AI健康+LAMP阳性 不一致", "healthy", "positive", false},
|
||||
{"AI未知+LAMP阳性 不一致", "unknown", "positive", false},
|
||||
{"LAMP无效 不一致", "sick", "invalid", false},
|
||||
{"无AI记录 不一致", "", "positive", false},
|
||||
}
|
||||
@@ -28,8 +29,8 @@ func TestCrossValidate(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAIClassFromDetections(t *testing.T) {
|
||||
if got := AIClassFromDetections(nil); got != "" {
|
||||
t.Errorf("空检测应为空,实际 %s", got)
|
||||
if got := AIClassFromDetections(nil); got != "unknown" {
|
||||
t.Errorf("空检测应为 unknown,实际 %s", got)
|
||||
}
|
||||
if got := AIClassFromDetections([]AIDetection{{ClassName: "healthy", Confidence: 0.9}}); got != "healthy" {
|
||||
t.Errorf("全健康应为 healthy,实际 %s", got)
|
||||
@@ -37,4 +38,7 @@ func TestAIClassFromDetections(t *testing.T) {
|
||||
if got := AIClassFromDetections([]AIDetection{{ClassName: "healthy"}, {ClassName: "sick", Confidence: 0.6}}); got != "sick" {
|
||||
t.Errorf("含 sick 应为 sick,实际 %s", got)
|
||||
}
|
||||
if got := AIClassFromDetections([]AIDetection{{ClassName: "unknown", Confidence: 0.6}}); got != "unknown" {
|
||||
t.Errorf("unknown 应为 unknown,实际 %s", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user