summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-11-07 20:40:44 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-11-07 20:40:44 +0100
commita97807bf3659fc5e34ff6756d804b0d9e0edf5a3 (patch)
tree17621dc6b597235de790c523d60efe7713384cf2 /t
parent297771540278864f464e43f78d7586c429b97486 (diff)
add get_station_by_location tests
Diffstat (limited to 't')
-rw-r--r--t/21-iris-stations.t28
1 files changed, 27 insertions, 1 deletions
diff --git a/t/21-iris-stations.t b/t/21-iris-stations.t
index 2e65e45..1d50ca5 100644
--- a/t/21-iris-stations.t
+++ b/t/21-iris-stations.t
@@ -4,7 +4,7 @@ use warnings;
use 5.014;
use utf8;
-use Test::More tests => 12;
+use Test::More tests => 14;
BEGIN {
use_ok('Travel::Status::DE::IRIS::Stations');
@@ -74,3 +74,29 @@ is_deeply(
],
'get_station: partial match with substring and levenshtein'
);
+
+is_deeply(
+ [ map { [$_->[0][0], $_->[0][1]] } Travel::Status::DE::IRIS::Stations::get_station_by_location(7.02458, 51.43862) ],
+ [
+ [ 'EESD', 'Essen Süd' ],
+ [ 'EE', 'Essen Hbf' ],
+ [ 'EESA', 'Essen Stadtwald' ],
+ [ 'EEUE', 'Essen-Überruhr' ],
+ [ 'EENW', 'Essen West' ],
+ [ 'EEST', 'Essen-Steele' ],
+ [ 'EEHU', 'Essen-Hügel' ],
+ [ 'EEHH', 'Essen-Holthausen' ],
+ [ 'EEKS', 'Essen-Kray Süd' ],
+ [ 'EESO', 'Essen-Steele Ost' ],
+ ],
+ 'get_station_by_location: 10 matches for Foobar'
+);
+
+is_deeply(
+ [ Travel::Status::DE::IRIS::Stations::get_station_by_location(7.02458, 51.43862, 1) ],
+ [
+ [[ 'EESD', 'Essen Süd', 8001897, 7.023098, 51.439295], 0.127234298397033]
+ ],
+ 'get_station_by_location: 1 match with all data for Foobar'
+);
+