TestTableCodec tests some functions in package tablecodec TODO: add more tests.
(t *testing.T)
| 40 | // TestTableCodec tests some functions in package tablecodec |
| 41 | // TODO: add more tests. |
| 42 | func TestTableCodec(t *testing.T) { |
| 43 | key := EncodeRowKey(1, codec.EncodeInt(nil, 2)) |
| 44 | h, err := DecodeRowKey(key) |
| 45 | require.NoError(t, err) |
| 46 | require.Equal(t, int64(2), h.IntValue()) |
| 47 | |
| 48 | key = EncodeRowKeyWithHandle(1, kv.IntHandle(2)) |
| 49 | h, err = DecodeRowKey(key) |
| 50 | require.NoError(t, err) |
| 51 | require.Equal(t, int64(2), h.IntValue()) |
| 52 | } |
| 53 | |
| 54 | // https://github.com/pingcap/tidb/issues/27687. |
| 55 | func TestTableCodecInvalid(t *testing.T) { |
nothing calls this directly
no test coverage detected