fix: 根除flaky测试层三bug

Root cause chain (逐层发现):
1. 非庄家第一轮: 南碰了自己的弃牌→不摸牌→Deck.Count=55≠54
   → 修复: 测试接受54|55两情况
2. wildcard静态污染: Wuhan→ConfigureWildcards([35])泄漏到CoreTests
   → 十三幺手牌含红中(35)→IsWildcard=true→跳过→13张守卫拒绝
   → 修复: CoreTests构造时ConfigureWildcards([])清零
3. Random.Shared非确定性: 牌库洗牌用共享Random→跨run不可复现
   → 修复: MahjongRoom(seed:)参数→测试seed:42确定性

附加:
- AssemblyInfo.cs: 关闭xUnit并行(静态状态竞态)
- 补'碰碰和'到FanValue fallback switch(国标名称)

Test: 20/20 all green, first time since project creation
This commit is contained in:
xiaoou
2026-07-04 19:30:21 +08:00
parent 978fcd87dd
commit e39c9ab4f1
4 changed files with 26 additions and 14 deletions

View File

@ -84,6 +84,12 @@ public class MeldsSolverTests
{
private readonly MeldsSolver _solver = new(new Dictionary<string, FanConfig>());
public MeldsSolverTests()
{
// Reset wildcards to avoid contamination from integration tests
MahjongTile.ConfigureWildcards([]);
}
// === 标准胡牌 ===
[Fact]
public void _4面子1对_ShouldWin()