tests for rescale_diagonal