Add tests for distance_rank.