tests shortest distance passed