From 2cb76946ee674340643c6538944a5a518fb4348c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 7 Oct 2015 11:21:40 +0200 Subject: proper route handling, generic route_pre / route_post in backend --- t/22-results-via.t | 79 +++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 40 deletions(-) (limited to 't') diff --git a/t/22-results-via.t b/t/22-results-via.t index 1960228..6366527 100644 --- a/t/22-results-via.t +++ b/t/22-results-via.t @@ -5,7 +5,7 @@ use 5.010; use utf8; use List::Util qw(first); -use Test::More tests => 23; +use Test::More tests => 16; BEGIN { use_ok('Travel::Status::DE::URA'); @@ -59,7 +59,7 @@ is( '"Aachen Bushof" via_after "Brand" does not contain other dests' ); -# via filter in ->results, explicit route_after +# via filter in ->results, explicit route calculation $s = Travel::Status::DE::URA->new( ura_base => 'file:t/in', @@ -69,7 +69,7 @@ $s = Travel::Status::DE::URA->new( ); @results = $s->results( via => 'Finkensief', - full_routes => 'after' + calculate_routes => 1, ); is( @results, 5, '"Aachen Bushof" via_after Finkensief' ); @@ -101,40 +101,39 @@ is( # via filter in ->results, explicit route_before -$s = Travel::Status::DE::URA->new( - ura_base => 'file:t/in', - ura_version => 1, - hide_past => 0, - stop => 'Aachen Bushof', -); -@results = $s->results( - via => 'Finkensief', - full_routes => 'before' -); - -is( @results, 5, '"Aachen Bushof" via_before Finkensief' ); -ok( ( first { $_->line == 25 } @results ), - '"Aachen Bushof" via_after "Brand" contains line 25' ); -ok( - ( first { $_->destination eq 'Vaals Heuvel' } @results ), - '"Aachen Bushof" via_after "Brand" contains dest Vaals Heuvel' -); -ok( ( first { $_->line == 1 } @results ), - '"Aachen Bushof" via_after "Brand" contains line 1' ); -ok( - ( first { $_->destination eq 'Lintert Friedhof' } @results ), - '"Aachen Bushof" via_after "Brand" contains dest Lintert Friedhof' -); -is( ( first { $_->line != 1 and $_->line != 25 } @results ), - undef, '"Aachen Bushof" via_after "Brand" does not contain anything else' ); -is( - ( - first { - $_->destination ne 'Vaals Heuvel' - and $_->destination ne 'Lintert Friedhof'; - } - @results - ), - undef, - '"Aachen Bushof" via_after "Brand" does not contain other dests' -); +#$s = Travel::Status::DE::URA->new( +# ura_base => 'file:t/in', +# ura_version => 1, +# hide_past => 0, +# stop => 'Aachen Bushof', +#); +#@results = $s->results( +# via => 'Finkensief', +#); +# +#is( @results, 5, '"Aachen Bushof" via_before Finkensief' ); +#ok( ( first { $_->line == 25 } @results ), +# '"Aachen Bushof" via_after "Brand" contains line 25' ); +#ok( +# ( first { $_->destination eq 'Vaals Heuvel' } @results ), +# '"Aachen Bushof" via_after "Brand" contains dest Vaals Heuvel' +#); +#ok( ( first { $_->line == 1 } @results ), +# '"Aachen Bushof" via_after "Brand" contains line 1' ); +#ok( +# ( first { $_->destination eq 'Lintert Friedhof' } @results ), +# '"Aachen Bushof" via_after "Brand" contains dest Lintert Friedhof' +#); +#is( ( first { $_->line != 1 and $_->line != 25 } @results ), +# undef, '"Aachen Bushof" via_after "Brand" does not contain anything else' ); +#is( +# ( +# first { +# $_->destination ne 'Vaals Heuvel' +# and $_->destination ne 'Lintert Friedhof'; +# } +# @results +# ), +# undef, +# '"Aachen Bushof" via_after "Brand" does not contain other dests' +#); -- cgit v1.2.3