You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

lock_compatibility_table_test.go 911 B

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package lockprovider
  2. import (
  3. "testing"
  4. . "github.com/smartystreets/goconvey/convey"
  5. "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/distlock/types"
  6. )
  7. func Test_LockCompatibilityTable(t *testing.T) {
  8. Convey("兼容,互斥,特殊比较", t, func() {
  9. table := LockCompatibilityTable{}
  10. table.
  11. Column("l1", func() bool { return true }).
  12. Column("l2", func() bool { return true }).
  13. Column("l3", func() bool { return false })
  14. comp := LockCompatible()
  15. uncp := LockUncompatible()
  16. spcl := LockSpecial(func(lock types.Lock, testLockName string) bool { return true })
  17. table.Row(comp, comp, comp)
  18. table.Row(comp, uncp, comp)
  19. table.Row(comp, comp, spcl)
  20. err := table.Test(types.Lock{
  21. Name: "l1",
  22. })
  23. So(err, ShouldBeNil)
  24. err = table.Test(types.Lock{
  25. Name: "l2",
  26. })
  27. So(err, ShouldNotBeNil)
  28. err = table.Test(types.Lock{
  29. Name: "l3",
  30. })
  31. So(err, ShouldBeNil)
  32. })
  33. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。