-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix api v2 decode of region bucket's keys (#757)
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
- Loading branch information
1 parent
fd1b055
commit 6a92aee
Showing
6 changed files
with
71 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package apicodec | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/tikv/client-go/v2/util/codec" | ||
) | ||
|
||
func TestV1DecodeBucketKey(t *testing.T) { | ||
c := NewCodecV1(ModeTxn) | ||
raw := []byte("test") | ||
encoded := codec.EncodeBytes(nil, raw) | ||
key, err := c.DecodeBucketKey(encoded) | ||
assert.Nil(t, err) | ||
assert.Equal(t, raw, key) | ||
|
||
raw = []byte{} | ||
encoded = codec.EncodeBytes(nil, raw) | ||
key, err = c.DecodeBucketKey(encoded) | ||
assert.Nil(t, err) | ||
assert.Equal(t, raw, key) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters