Add EuclideanDistance unit test

Not to be merged at this moment since the test fails, see #1351 for a description of the problem.