修复相关BUG + 增加单元测试, 覆盖率100%

This commit is contained in:
2025-04-20 17:57:01 +08:00
parent 299edfcc9a
commit fb1d6bb34f
19 changed files with 669 additions and 134 deletions

View File

@ -24,6 +24,10 @@ func TestRedisCmd_String(t *testing.T) {
Convey("redis cmd MarshalJSON", t, func() {
str, err := RedisCommandSet.MarshalJSON()
So(err, ShouldBeNil)
So(string(str), ShouldEqual, `SET`)
So(string(str), ShouldEqual, `"SET"`)
dataList := []RedisCmd{RedisCommandSet}
jsonData, err := json.Marshal(dataList)
So(err, ShouldBeNil)
So(string(jsonData), ShouldEqual, `["SET"]`)
})
}