Add unit test for distance computation.