You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: keys_test.go
    path of file: ./repos/cockroach/pkg/keys
    
    the code of the file until where you have to start completion: // Copyright 2014 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in t
    
func TestBatchError(t *testing.T) {
	testCases := []struct {
		req    [2]string
		errMsg string
	}{
		{
			req:    [2]string{"\xff\xff\xff\xff", "a"},
			errMsg: "must be less than KeyMax",
		},
		{
			req:    [2]string{"a", "\xff\xff\xff\xff"},
			errMsg: "must be less than or equal to KeyMax",
		},
	}

	for i, c := range testCases {
		var ba kvpb.BatchRequest
		ba.Add(&kvpb.ScanRequest{RequestHeader: kvpb.RequestHeader{
			Key: roachpb.Key(c.req[0]), EndKey: roachpb.Key(c.req[1]),
		}})
		if _, err := Range(ba.Requests); !testutils.IsError(err, c.errMsg) {
			t.Errorf("%d: unexpected error %v", i, err)
		}
	}

	// Test a case where a non-range request has an end key.
	var ba kvpb.BatchRequest
	ba.Add(&kvpb.GetRequest{RequestHeader: kvpb.RequestHeader{
		Key: roachpb.Key("a"), EndKey: roachpb.Key("b"),
	}})
	if _, err := Range(ba.Requests); !testutils.IsError(err, "end key specified for non-range operation") {
		t.Errorf("unexpected error %v", err)
	}
}