test: 完善单元测试基础设施和测试覆盖 - #11
Merged
Merged
Conversation
- 为 Permission 枚举添加 Hash derive 以支持集合操作 - 完善 Permission 单元测试: - 添加完整的排序测试用例 - 添加 Anyone 权限的 always_true 测试 - 添加 BotOwner 权限的精确匹配测试 - 添加 BotOwner 权限的匹配失败测试 - 添加边界情况测试(下划线、大小写敏感) - 完善 PersonaStore 单元测试: - 添加重复 ID 创建失败测试 - 添加空 ID 创建成功测试 - 添加空名称创建成功测试 - 移除重复的 get_all 空值测试 - 优化导入顺序
- 添加测试基础设施: - 创建测试通用模块 (tests/common/) - 实现 Bot 夹具和房间创建辅助函数 - 配置并发测试支持 - 完善 MCP 命令测试: - 添加 !mcp list 命令测试 - 添加 !mcp servers 命令测试 - 添加权限验证测试 - 完善 Persona 命令测试: - 添加 !persona list/set/info 命令测试 - 添加 !persona create/delete 命令测试 - 添加房间管理员权限验证测试 - 完善 muito 命令测试: - 添加 !muito 相关命令测试 - 验证命令响应格式 - 优化测试代码结构: - 使用 let-chains 简化代码 - 移除冗余导入和代码 - 修复警告和 clippy 问题 - 更新文档: - 添加 TESTING.md 测试指南 - 创建测试自动化脚本 - 更新 Makefile 测试目标
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
!mcp list、!mcp servers命令测试及权限验证!persona list/set/info/create/delete命令测试及权限验证共增加 4700+ 行测试代码,显著提升测试覆盖率。