feat(parser): 支持 Ploss Field1 十六进制解析

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Scottxjw
2026-08-17 10:47:33 +08:00
parent 36c21f03dd
commit 6d56a4a01b
4 changed files with 80 additions and 10 deletions

View File

@@ -87,6 +87,26 @@ public class AnalyzeCommandTests : CommandTestBase
Assert.That(stdout, Does.Contain("Please specify --pure and --foreign for Qfod calibration"));
}
[Test]
public async Task Analyze_Ploss_LegacyFile_HexField1_DecodedCorrectly()
{
var dir = NewDir();
// 旧单行格式 Field1=0C (十六进制) 应被解析为十进制 12
var file = TestFixtures.WriteLegacyPlossLog(
dir,
"singleMold-v1.0-hex2_1-iPhone15-ploss_legacy-20260710-1.log",
new (int, int, int)[] { (500, 3000, 0) },
field1Hex: "0C");
var (code, stdout, _) = await Analyze().RunCaptureAsync("--type", "ploss", "--file", file);
Assert.Multiple(() =>
{
Assert.That(code, Is.EqualTo(0));
Assert.That(stdout, Does.Contain("Total: 1 (TwoLine: 0, Legacy: 1), FOD: 0, Errors: 0"));
});
}
[Test]
public async Task Analyze_Qfod_ValidFiles_ReportsThreshold()
{