Tests for calculating distance