diff options
-rw-r--r-- | lib/Travel/Status/DE/IRIS.pm | 10 | ||||
-rw-r--r-- | t/20-iris-class.t | 2 | ||||
-rw-r--r-- | t/31-result-basics.t | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm index 6d712de..733a73c 100644 --- a/lib/Travel/Status/DE/IRIS.pm +++ b/lib/Travel/Status/DE/IRIS.pm @@ -144,11 +144,11 @@ sub new { } @{ $self->{results} } = grep { - my $d = ( $_->departure // $_->arrival ); - my $sd = $_->sched_departure // $_->sched_arrival // $d; - $d = $d->subtract_datetime( $self->{datetime} ); - $sd = $sd->subtract_datetime( $self->{datetime} ); - not $d->is_negative and $sd->in_units('minutes') < $self->{lookahead} + my $d = $_->departure // $_->arrival; + my $s = $_->sched_arrival // $_->sched_departure // $_->arrival // $d; + $d = $d->subtract_datetime( $self->{datetime} ); + $s = $s->subtract_datetime( $self->{datetime} ); + not $d->is_negative and $s->in_units('minutes') < $self->{lookahead} } @{ $self->{results} }; @{ $self->{results} } diff --git a/t/20-iris-class.t b/t/20-iris-class.t index 65a2d60..69e1c45 100644 --- a/t/20-iris-class.t +++ b/t/20-iris-class.t @@ -4,7 +4,7 @@ use warnings; use 5.014; use DateTime; -use Test::More tests => 268; +use Test::More tests => 270; BEGIN { use_ok('Travel::Status::DE::IRIS'); diff --git a/t/31-result-basics.t b/t/31-result-basics.t index 4468a53..b587271 100644 --- a/t/31-result-basics.t +++ b/t/31-result-basics.t @@ -5,7 +5,7 @@ use 5.014; use utf8; use DateTime; -use Test::More tests => 432; +use Test::More tests => 435; use Test::Fatal; use Travel::Status::DE::IRIS; @@ -26,7 +26,7 @@ my $status = Travel::Status::DE::IRIS->new( my @results = $status->results; -is(scalar @results, 132, 'got 132 results'); +is(scalar @results, 133, 'got 133 results'); my $ice645 = $results[0]; my $s1 = $results[1]; |