Skip to content

Commit

Permalink
Add test for Wikipedia coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
cdauth committed Mar 27, 2024
1 parent 02d4ab0 commit 0e22ed2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/src/__tests__/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ test("matchLonLat", () => {

// Practical examples
expect(matchLonLat("N 53°53’42.8928” E 10°44’13.4844”")).toEqual({ lat: 53.895248, lon: 10.737079 }); // Park4night
expect(matchLonLat("53°53'42.8928\"N 10°44'13.4844\"E")).toEqual({ lat: 53.895248, lon: 10.737079 }); // Google Maps
expect(matchLonLat("53°53'42.9\"N 10°44'13.5\"E")).toEqual({ lat: 53.895250, lon: expect.closeTo(10.737083, 6) }); // Google Maps
expect(matchLonLat("55°41′34.3″N 12°35′57.4″E")).toEqual({ lat: expect.closeTo(55.692861, 6), lon: expect.closeTo(12.599278, 6) }); // Wikipedia

// Invalid lon/lat combination
expect(matchLonLat("1° 24' N 2° 36' N")).toEqual(undefined);
Expand Down

0 comments on commit 0e22ed2

Please sign in to comment.