diff --git a/test/db.js b/test/db.js index 20328df6..7741ffa4 100644 --- a/test/db.js +++ b/test/db.js @@ -56,8 +56,8 @@ const isJungfernheide = (s) => { (s.id === '008011167' || s.id === jungfernh) && s.name === 'Berlin Jungfernheide' && s.location && - isRoughlyEqual(s.location.latitude, 52.530408, .0005) && - isRoughlyEqual(s.location.longitude, 13.299424, .0005) + isRoughlyEqual(.0005, s.location.latitude, 52.530408) && + isRoughlyEqual(.0005, s.location.longitude, 13.299424) } const assertIsJungfernheide = (t, s) => { @@ -65,8 +65,8 @@ const assertIsJungfernheide = (t, s) => { t.ok(s.id === '008011167' || s.id === jungfernh, 'id should be 8011167') t.equal(s.name, 'Berlin Jungfernheide') t.ok(s.location) - t.ok(isRoughlyEqual(s.location.latitude, 52.530408, .0005)) - t.ok(isRoughlyEqual(s.location.longitude, 13.299424, .0005)) + t.ok(isRoughlyEqual(.0005, s.location.latitude, 52.530408)) + t.ok(isRoughlyEqual(.0005, s.location.longitude, 13.299424)) } // todo: DRY with assertValidStationProducts diff --git a/test/insa.js b/test/insa.js index f510e28a..7e2b1b38 100644 --- a/test/insa.js +++ b/test/insa.js @@ -40,8 +40,8 @@ const isMagdeburgHbf = s => { (s.id === '8010224' || s.id === '008010224') && s.name === 'Magdeburg Hbf' && s.location && - isRoughlyEqual(s.location.latitude, 52.130352, 0.001) && - isRoughlyEqual(s.location.longitude, 11.626891, 0.001) + isRoughlyEqual(.001, s.location.latitude, 52.130352) && + isRoughlyEqual(.001, s.location.longitude, 11.626891) ) } @@ -50,8 +50,8 @@ const assertIsMagdeburgHbf = (t, s) => { t.ok(s.id === '8010224' || s.id === '008010224', 'id should be 8010224') t.equal(s.name, 'Magdeburg Hbf') t.ok(s.location) - t.ok(isRoughlyEqual(s.location.latitude, 52.130352, 0.001)) - t.ok(isRoughlyEqual(s.location.longitude, 11.626891, 0.001)) + t.ok(isRoughlyEqual(.001, s.location.latitude, 52.130352)) + t.ok(isRoughlyEqual(.001, s.location.longitude, 11.626891)) } // todo: DRY with assertValidStationProducts diff --git a/test/nahsh.js b/test/nahsh.js index 50a561b7..6ee4d33f 100644 --- a/test/nahsh.js +++ b/test/nahsh.js @@ -43,8 +43,8 @@ const isKielHbf = (s) => { (s.id === '8000199') && s.name === 'Kiel Hbf' && s.location && - isRoughlyEqual(s.location.latitude, 54.314982, .0005) && - isRoughlyEqual(s.location.longitude, 10.131976, .0005) + isRoughlyEqual(.0005, s.location.latitude, 54.314982) && + isRoughlyEqual(.0005, s.location.longitude, 10.131976) } const assertIsKielHbf = (t, s) => { @@ -52,8 +52,8 @@ const assertIsKielHbf = (t, s) => { t.ok(s.id === '8000199', 'id should be 8000199') t.equal(s.name, 'Kiel Hbf') t.ok(s.location) - t.ok(isRoughlyEqual(s.location.latitude, 54.314982, .0005)) - t.ok(isRoughlyEqual(s.location.longitude, 10.131976, .0005)) + t.ok(isRoughlyEqual(.0005, s.location.latitude, 54.314982)) + t.ok(isRoughlyEqual(.0005, s.location.longitude, 10.131976)) } // todo: DRY with assertValidStationProducts diff --git a/test/oebb.js b/test/oebb.js index a45dc0b1..9db6a42f 100644 --- a/test/oebb.js +++ b/test/oebb.js @@ -60,8 +60,8 @@ const isSalzburgHbf = (s) => { (s.id === '008100002' || s.id === '8100002') && s.name === 'Salzburg Hbf' && s.location && - isRoughlyEqual(s.location.latitude, 47.812851, .0005) && - isRoughlyEqual(s.location.longitude, 13.045604, .0005) + isRoughlyEqual(.0005, s.location.latitude, 47.812851) && + isRoughlyEqual(.0005, s.location.longitude, 13.045604) } const assertIsSalzburgHbf = (t, s) => { @@ -69,8 +69,8 @@ const assertIsSalzburgHbf = (t, s) => { t.ok(s.id === '008100002' || s.id === '8100002', 'id should be 8100002') t.equal(s.name, 'Salzburg Hbf') t.ok(s.location) - t.ok(isRoughlyEqual(s.location.latitude, 47.812851, .0005)) - t.ok(isRoughlyEqual(s.location.longitude, 13.045604, .0005)) + t.ok(isRoughlyEqual(.0005, s.location.latitude, 47.812851)) + t.ok(isRoughlyEqual(.0005, s.location.longitude, 13.045604)) } // todo: DRY with assertValidStationProducts