OpenAtomFoundation / pikiwidb

a high-performance, large-capacity, multi-tenant, data-persistent, strong data consistency based on raft, Redis-compatible elastic KV data storage system based on RocksDB
BSD 3-Clause "New" or "Revised" License
195 stars 63 forks source link

doc: unify `key` in unit tests #159

Closed hero-heng closed 5 months ago

hero-heng commented 7 months ago

Which PikiwiDB functionalities are relevant/related to the feature request?

No response

Description

如果只使用一个 key ,就使用 DefaultKey ,有定义的常量。 如果要用到多个 key 也可以使用定义好的 key。 --尽量不要使用字符串,需要统一一下代码风格 问题类似于https://github.com/OpenAtomFoundation/pikiwidb/blob/8af88a4cdebbd6dc68c8a46ca5c60b0822f472ed/tests/string_test.go#L197 更改后的应为 https://github.com/OpenAtomFoundation/pikiwidb/blob/8af88a4cdebbd6dc68c8a46ca5c60b0822f472ed/tests/string_test.go#L152

Proposed solution

33d421cd671e42bdd81a288419d47e0

Alternatives considered

none

hero-heng commented 7 months ago

还有一点就是 按理每一个命令执行测试之前需要清除掉它未来需要用到的key 如https://github.com/OpenAtomFoundation/pikiwidb/blob/8af88a4cdebbd6dc68c8a46ca5c60b0822f472ed/tests/string_test.go#L147