diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-29 09:27:16 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-29 09:27:16 +0800 |
| commit | 1d56991fadfaa6eb43d98b904db59685e77c220a (patch) | |
| tree | 803e234f01d5014d49099c4900b43cf29622d62c /src/LivingVillage.Desktop.Tests | |
| parent | 7c741c127798dcaf08deee56ed4ed91d9dc307b4 (diff) | |
| download | living-village-1d56991fadfaa6eb43d98b904db59685e77c220a.tar.gz | |
p69: 中文 UI 文案统一审校(面板措辞/交易缺货口径/页脚留白与 ESC)
- 面板打开语统一:「年鉴已打开」→「年鉴面板已打开」(Interaction + requiredUiLabels)
- 交易缺货口径统一:「背包不足」→「库存不足」(PlayerTrade,与对话交易失败名一致)
- 分页页脚留白/大小写统一:「…页 空格 翻页 Esc 关闭」→「…页 空格 翻页 ESC 关闭」
- P69CopyAuditTests(2 例,红先)+ P61 钉住样例同步
- 只改字符串字面量与相关断言;Kernel/Sim/MapSnapshot 未动
- Desktop 338/338、Kernel 119/119;digest 953775FA…7F6C 不变
Diffstat (limited to 'src/LivingVillage.Desktop.Tests')
3 files changed, 37 insertions, 1 deletions
diff --git a/src/LivingVillage.Desktop.Tests/LivingVillage.Desktop.Tests.fsproj b/src/LivingVillage.Desktop.Tests/LivingVillage.Desktop.Tests.fsproj index 6d1a3e8..a404797 100644 --- a/src/LivingVillage.Desktop.Tests/LivingVillage.Desktop.Tests.fsproj +++ b/src/LivingVillage.Desktop.Tests/LivingVillage.Desktop.Tests.fsproj @@ -41,6 +41,7 @@ <Compile Include="P66TaskTargetTests.fs" /> <Compile Include="P67TaskTargetUiTests.fs" /> <Compile Include="P68MapSnapshotTests.fs" /> + <Compile Include="P69CopyAuditTests.fs" /> <Compile Include="SampleTests.fs" /> </ItemGroup> diff --git a/src/LivingVillage.Desktop.Tests/P61GlyphCoverageTests.fs b/src/LivingVillage.Desktop.Tests/P61GlyphCoverageTests.fs index f5f1a10..a2c1038 100644 --- a/src/LivingVillage.Desktop.Tests/P61GlyphCoverageTests.fs +++ b/src/LivingVillage.Desktop.Tests/P61GlyphCoverageTests.fs @@ -82,7 +82,7 @@ type P61GlyphCoverageTests () = let pinned = [ HudLayout.seasonNames |> String.concat "" HudLayout.calendarLine1 { Season = "春"; DayNumber = 1L; Period = "清晨"; Clock = "06:00" } - "第 1/3 页 空格 翻页 Esc 关闭" + "第 1/3 页 空格 翻页 ESC 关闭" "背包物品×1" "鱼"; "卷轴"; "香料"; "玩家"; "回车:接受任务" ] let missing = diff --git a/src/LivingVillage.Desktop.Tests/P69CopyAuditTests.fs b/src/LivingVillage.Desktop.Tests/P69CopyAuditTests.fs new file mode 100644 index 0000000..cd5e221 --- /dev/null +++ b/src/LivingVillage.Desktop.Tests/P69CopyAuditTests.fs @@ -0,0 +1,35 @@ +namespace LivingVillage.Desktop.Tests + +open Microsoft.VisualStudio.TestTools.UnitTesting +open LivingVillage.Kernel +open LivingVillage.Kernel.Sim +open LivingVillage.Desktop + +/// P69(文案统一审校):把玩家可见中文文案里不一致的措辞/大小写/留白拉齐,并补回归断言。 +/// 本单只改字符串字面量与相关断言;不改逻辑、不改 Kernel/Sim。 +[<TestClass>] +type P69CopyAuditTests () = + + [<TestMethod>] + member _.PanelStatusWordingIsUnified () = + // 「需求面板已打开 / 任务面板已打开」同一句式;年鉴原为「年鉴已打开」,统一为「年鉴面板已打开」。 + Assert.AreEqual<string>( + "年鉴面板已打开", + M5Interaction.statusText { M5Interaction.initial with Status = "chronicle" }) + Assert.AreEqual<string>( + "需求面板已打开", + M5Interaction.statusText { M5Interaction.initial with Status = "needs panel open" }) + Assert.AreEqual<string>( + "任务面板已打开", + M5Interaction.statusText { M5Interaction.initial with Status = "task panel open" }) + Assert.IsTrue(ChineseText.requiredUiLabels |> List.contains "年鉴面板已打开") + Assert.IsFalse(ChineseText.requiredUiLabels |> List.contains "年鉴已打开") + + [<TestMethod>] + member _.TradeShortageUsesStockWording () = + // 交易缺货口径统一为「库存不足」(与对话交易失败名一致),不再用「背包不足」。 + let state = { Occupation.stateOf Occupation.Farmer with Backpack = [ (Food, 1) ] } + let world = WorldBootstrap.initialWorldWithOccupation false 42UL 4 (Some state) + let outcome = PlayerTrade.sell (Some state) (NpcId 0) Food 3 world + Assert.IsFalse(outcome.Succeeded, "shortage sale must not succeed") + Assert.AreEqual<string>("库存不足", outcome.Message) |
