修复相关BUG + 增加单元测试, 覆盖率100%
This commit is contained in:
@ -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"]`)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user