test for key index consistency