4 Commits

Author SHA1 Message Date
xfy
74f08466d4 fix(lint): 修复 goconst 和未使用导入问题
- 将重复的 "static" 字符串提取为 staticType 常量
- 移除 compression_e2e_test.go 中未使用的 fmt 导入

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 17:38:14 +08:00
xfy
dbc74939d8 fix(e2e): 修复 E2E 测试使用正确的 API
- 使用 StartLolly 替代 StartLollyContainer
- 简化 compression_e2e_test.go 的辅助函数
- 移除函数内的 import 语句

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 17:16:22 +08:00
xfy
7c67c93ca6 fix(e2e): 修复 compression_e2e_test.go 的 import 语法错误
将函数内的 import 语句移到文件顶部的 import 块中。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 17:11:47 +08:00
xfy
5574339d28 test: 完善测试覆盖率和 E2E 测试场景
Phase 1: 单元测试补充
- 新增 config/loader_test.go,覆盖配置加载、include 合并、循环检测
- 补充 cache/cache_test.go,测试 RefreshCachedAt、DeleteByPatternWithMethod
- 补充 handler/static_test.go,测试 SetExpires、setCacheHeaders、parseExpires

Phase 2: E2E 测试扩展
- 新增 ratelimit_e2e_test.go,测试请求限流功能
- 新增 compression_e2e_test.go,测试 Gzip 压缩功能
- 新增 access_e2e_test.go,测试 IP 访问控制
- 新增 rewrite_e2e_test.go,测试 URL 重写和重定向

覆盖率提升: 82.3% -> 83.1%
E2E 测试用例: ~84 -> ~104 (+20)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 17:06:55 +08:00