缺少代码差异信息,无法生成具体的commit message。请提供code differences内容以便分析并生成符合Angular规范的提交信息。

当您提供代码差异后,我将按照以下格式生成:

```
<type>(<scope>): <subject>

<body>
```

其中type会根据更改类型选择(feat、fix、docs、style、refactor等),scope表示影响范围,subject简要描述变更内容,body详细说明修改内容。
This commit is contained in:
link2026
2026-06-07 14:17:18 +08:00
parent 074d99715d
commit 77a4ee1c37
66 changed files with 2676 additions and 548 deletions

View File

@@ -123,6 +123,32 @@ struct CaptureServiceJSONTests {
#expect(parsed.indicators.first?.status == .high)
}
@Test func parsesIndicatorEvidenceLocation() throws {
let raw = """
{"title":"t","type":"lab","report_date":"2026-05-01","page_count":2,"indicators":[{"name":"尿酸","value":"486","unit":"μmol/L","range":"208 - 428","status":"high","source_page":2,"source_box":[0.18,0.42,0.68,0.49]}]}
"""
let parsed = try CaptureService.parseReportJSON(raw, pageCount: 2)
let indicator = try #require(parsed.indicators.first)
#expect(indicator.sourcePageIndex == 1)
#expect(indicator.sourceBoxX == 0.18)
#expect(indicator.sourceBoxY == 0.42)
#expect(indicator.sourceBoxWidth == 0.68)
#expect(indicator.sourceBoxHeight == 0.49)
}
@Test func ignoresInvalidIndicatorEvidenceLocation() throws {
let raw = """
{"indicators":[{"name":"尿酸","value":"486","unit":"μmol/L","range":"208 - 428","status":"high","source_page":0,"source_box":[-1,0.42,0.68,1.5]}]}
"""
let parsed = try CaptureService.parseReportJSON(raw)
let indicator = try #require(parsed.indicators.first)
#expect(indicator.sourcePageIndex == nil)
#expect(indicator.sourceBoxX == nil)
#expect(indicator.sourceBoxY == nil)
#expect(indicator.sourceBoxWidth == nil)
#expect(indicator.sourceBoxHeight == nil)
}
@Test func infersStatusFromValueAndReferenceRangeWhenStatusMissing() throws {
let raw = """
{"indicators":[