feat(Capture): 归档后后台预生成大白话摘要,详情页秒开 + 兜底重试
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
26
康康Tests/InsightPromptsTests.swift
Normal file
26
康康Tests/InsightPromptsTests.swift
Normal file
@@ -0,0 +1,26 @@
|
||||
import Testing
|
||||
@testable import 康康
|
||||
|
||||
struct InsightPromptsTests {
|
||||
|
||||
@Test func reportSummaryPromptCarriesDataAndGuards() {
|
||||
let p = InsightPrompts.reportPlainSummary(
|
||||
title: "春季体检", typeLabel: "体检报告",
|
||||
indicatorLines: "血红蛋白 118 g/L(参考 130-175)low")
|
||||
#expect(p.contains("春季体检"))
|
||||
#expect(p.contains("血红蛋白 118"))
|
||||
#expect(p.contains("/no_think"))
|
||||
#expect(p.contains("不诊断"))
|
||||
#expect(!p.contains("患者"))
|
||||
}
|
||||
|
||||
@Test func trendPromptCarriesDataAndGuards() {
|
||||
let p = InsightPrompts.trendInsight(
|
||||
title: "空腹血糖", unit: "mmol/L", rangeText: ",参考 3.9-6.1",
|
||||
dataLines: "2026-05-01 5.2 / 2026-06-01 5.8")
|
||||
#expect(p.contains("空腹血糖"))
|
||||
#expect(p.contains("2026-06-01 5.8"))
|
||||
#expect(p.contains("/no_think"))
|
||||
#expect(!p.contains("患者"))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user