From 4d908e1f72454634f733eae6e51f3eb5ceb62380 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Sun, 13 May 2018 01:03:10 +0200 Subject: [PATCH] tests: fix isRoughEqual call :bug:, minor change --- test/db.js | 5 ++--- test/oebb.js | 4 ++-- test/vbb.js | 5 +++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/db.js b/test/db.js index 214ce9d0..ea492d2a 100644 --- a/test/db.js +++ b/test/db.js @@ -244,12 +244,11 @@ test('nearby Berlin Jungfernheide', co(function* (t) { // todo: trim IDs t.ok(s0.id === '008011167' || s0.id === jungfernheide) t.equal(s0.name, 'Berlin Jungfernheide') - t.ok(isRoughlyEqual(s0.location.latitude, 52.530408, .0005)) - t.ok(isRoughlyEqual(s0.location.longitude, 13.299424, .0005)) + t.ok(isRoughlyEqual(.0005, s0.location.latitude, 52.530408)) + t.ok(isRoughlyEqual(.0005, s0.location.longitude, 13.299424)) t.ok(s0.distance >= 0) t.ok(s0.distance <= 100) - // todo: nearby[0] t.end() })) diff --git a/test/oebb.js b/test/oebb.js index 10e9ec2e..73929b01 100644 --- a/test/oebb.js +++ b/test/oebb.js @@ -269,8 +269,8 @@ test('nearby Salzburg Hbf', co(function* (t) { const s = nearby[0] t.ok(s.id === '008100002' || s.id === '8100002', 'id should be 8100002') t.equal(s.name, 'Salzburg Hbf') - 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)) t.ok(s.distance >= 0) t.ok(s.distance <= 100) diff --git a/test/vbb.js b/test/vbb.js index e1f6d79c..db7530ac 100644 --- a/test/vbb.js +++ b/test/vbb.js @@ -108,8 +108,6 @@ const bismarckstr = '900000024201' const westhafen = '900000001201' const wedding = '900000009104' const württembergallee = '900000026153' -const berlinerStr = '900000044201' -const landhausstr = '900000043252' test('journeys – Spichernstr. to Bismarckstr.', co(function* (t) { const journeys = yield client.journeys(spichernstr, bismarckstr, { @@ -301,6 +299,9 @@ test('departures at 7-digit station', co(function* (t) { })) test('nearby', co(function* (t) { + const berlinerStr = '900000044201' + const landhausstr = '900000043252' + // Berliner Str./Bundesallee const nearby = yield client.nearby({ type: 'location',