indexCopy

I realise there's no error with my code, but just that the test code has error. I modified the dimension of test code, and also included an assertion to raise error if the dimension of src:size[dim] is not equal to the length of the indices