Skip to content

Commit ff7c325

Browse files
committed
test: 为多个模块添加测试以提升覆盖率至50%
- 新增 win.Tests.ps1 测试 Windows 专用函数(Add-Startup, New-Shortcut) - 新增 wrapper.Tests.ps1 测试别名管理函数(Set-CustomAlias, Get-CustomAlias) - 新增 hardware.Tests.ps1 测试硬件信息函数(Get-GpuInfo, Get-SystemMemoryInfo) - 扩展 os.Tests.ps1 测试以覆盖更多操作系统检测场景和边缘情况 - 扩展 functions.Tests.ps1 测试以覆盖版本管理、格式转换、脚本管理等函数 - 扩展 install.Tests.ps1 测试以覆盖模块安装、应用过滤、包管理器命令生成 - 扩展 test.Tests.ps1 测试以覆盖可执行程序检测、路径检查、缓存清理 - 扩展 env.Tests.ps1 测试以覆盖环境变量加载、路径同步、参数获取 - 扩展 help.Tests.ps1 测试以覆盖帮助搜索、内容解析、性能对比 - 扩展 web.Tests.ps1 测试以覆盖网页快捷方式创建、内部函数逻辑 - 更新任务清单以标记所有测试任务已完成,确认覆盖率目标达成
1 parent a3dd5c3 commit ff7c325

13 files changed

Lines changed: 2427 additions & 153 deletions

File tree

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
## 1. Coverage Baseline
22

3-
- [ ] 1.1 Record current coverage output and module-level gaps
4-
- [ ] 1.2 Identify top 3 modules to prioritize for new tests
3+
- [x] 1.1 Record current coverage output and module-level gaps
4+
- [x] 1.2 Identify top 3 modules to prioritize for new tests
55

66
## 2. Add Tests for High-Impact Modules
77

8-
- [ ] 2.1 Add tests for `hardware.psm1` using mocks for system probes
9-
- [ ] 2.2 Add tests for `win.psm1` and `wrapper.psm1` with mockable dependencies
8+
- [x] 2.1 Add tests for `hardware.psm1` using mocks for system probes
9+
- [x] 2.2 Add tests for `win.psm1` and `wrapper.psm1` with mockable dependencies
1010

1111
## 3. Deepen Existing Coverage
1212

13-
- [ ] 3.1 Expand tests for `install.psm1` beyond module detection
14-
- [ ] 3.2 Expand tests for `functions.psm1` edge cases and error paths
13+
- [x] 3.1 Expand tests for `install.psm1` beyond module detection
14+
- [x] 3.2 Expand tests for `functions.psm1` edge cases and error paths
1515

1616
## 4. Verify Coverage Target
1717

18-
- [ ] 4.1 Run coverage and confirm >=50%
19-
- [ ] 4.2 Document any remaining low-coverage modules and follow-up items
18+
- [x] 4.1 Run coverage and confirm >=50%
19+
- [x] 4.2 Document any remaining low-coverage modules and follow-up items

0 commit comments

Comments
 (0)