Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

测试代码重复问题 #26

Open
3 tasks done
longyue0521 opened this issue Oct 10, 2023 · 1 comment
Open
3 tasks done

测试代码重复问题 #26

longyue0521 opened this issue Oct 10, 2023 · 1 comment
Labels
question Further information is requested

Comments

@longyue0521
Copy link
Contributor

仅限中文

在提之前请先查找已有 issues,避免重复上报。

并且确保自己已经:

  • 阅读过文档
  • 阅读过注释
  • 阅读过例子

你的问题

当前仓库中测试代码有很多重复,在我提交的PR #25 ,我试着通过传入不同的具体实现来得到ecode.Cache实例, 然后针对ecode.Cache实例编写测试代码发现只需要一套e2e测试代码即可

详见memory/lru/cache_test.go的TestCache_Delete与redis/cache_e2e_test.go的TestCache_e2e_Delete. 经过抽象两者只有newCache的实现不一样.

建议使用testify维护一套测试e2e测试套件针对ecode.Cache实例测试即可, 然后传入不同的具体实例调用同一套测试套件即可.

你使用的是 ecache 哪个版本?

你设置的的 Go 环境?

上传 go env 的结果

@longyue0521 longyue0521 added the question Further information is requested label Oct 10, 2023
@flycash
Copy link
Contributor

flycash commented Jul 17, 2024

这个确实是需要重构的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants