diff --git a/pkg/keyspace/tso_keyspace_group_test.go b/pkg/keyspace/tso_keyspace_group_test.go index d82d8ed363c..e8a40a839c8 100644 --- a/pkg/keyspace/tso_keyspace_group_test.go +++ b/pkg/keyspace/tso_keyspace_group_test.go @@ -484,8 +484,8 @@ func TestBuildSplitKeyspaces(t *testing.T) { err: ErrKeyspaceNotInKeyspaceGroup, }, { - old: []uint32{1, 2}, - new: []uint32{2, 2}, + old: []uint32{1, 2}, + new: []uint32{2, 2}, expectedOld: []uint32{1}, expectedNew: []uint32{2}, }, @@ -510,6 +510,13 @@ func TestBuildSplitKeyspaces(t *testing.T) { expectedOld: []uint32{1, 5}, expectedNew: []uint32{2, 3, 4}, }, + { + old: []uint32{1, 2, 3, 4, 5}, + startKeyspaceID: 5, + endKeyspaceID: 6, + expectedOld: []uint32{1, 2, 3, 4}, + expectedNew: []uint32{5}, + }, { old: []uint32{1, 2, 3, 4, 5}, startKeyspaceID: 2, @@ -517,6 +524,13 @@ func TestBuildSplitKeyspaces(t *testing.T) { expectedOld: []uint32{1}, expectedNew: []uint32{2, 3, 4, 5}, }, + { + old: []uint32{1, 2, 3, 4, 5}, + startKeyspaceID: 1, + endKeyspaceID: 1, + expectedOld: []uint32{2, 3, 4, 5}, + expectedNew: []uint32{1}, + }, { old: []uint32{1, 2, 3, 4, 5}, startKeyspaceID: 0, @@ -524,6 +538,13 @@ func TestBuildSplitKeyspaces(t *testing.T) { expectedOld: []uint32{}, expectedNew: []uint32{1, 2, 3, 4, 5}, }, + { + old: []uint32{1, 2, 3, 4, 5}, + startKeyspaceID: 7, + endKeyspaceID: 10, + expectedOld: []uint32{1, 2, 3, 4, 5}, + expectedNew: []uint32{}, + }, { old: []uint32{1, 2, 3, 4, 5}, err: ErrKeyspaceNotInKeyspaceGroup,