Commit 843388f8 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

return a delay of undef when no delay information is available

parent 2cdd2e22
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
git HEAD

    * Result->delay: return undef when no data is available. This allows to
      distinguish between on-time departures (delay 0) and departures without
      realtime data (delay undef)

Travel::Status::DE::VRR 1.09 - Thu Apr 30 2015

    * EFA: Fix crash when ->results is called after a network error occured
+1 −1
Original line number Diff line number Diff line
@@ -336,7 +336,7 @@ sub results {
		my $info          = $e_info->textContent;
		my $key           = $e_line->getAttribute('key');
		my $countdown     = $e->getAttribute('countdown');
		my $delay         = $e_info->getAttribute('delay') // 0;
		my $delay         = $e_info->getAttribute('delay');
		my $type          = $e_info->getAttribute('name');

		my $platform_is_db = 0;
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ sub new {

	my $ref = \%conf;

	if ( $ref->{delay} eq '-9999' ) {
	if ( defined $ref->{delay} and $ref->{delay} eq '-9999' ) {
		$ref->{delay}        = 0;
		$ref->{is_cancelled} = 1;
	}
@@ -86,7 +86,7 @@ Actual departure date (DD.MM.YYYY).
=item $departure->delay

Expected delay from scheduled departure time in minutes. A delay of 0
indicates either departure on time or that no delay information is available.
indicates departure on time. undef when no realtime information is available.

=item $departure->destination

+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ is($results[3]->info, decode('UTF-8', 'Ab (H) Heißen Kirche, Umstieg in den SEV
is($results[3]->line, '18', 'fourth result: line ok');
is($results[3]->date, '16.11.2011', 'fourth result: real date ok');
is($results[3]->time, '09:39', 'fourth result: real time ok');
is($results[3]->delay, 0, 'fourth result: delay 0');
is($results[3]->delay, undef, 'fourth result: delay undef');
is($results[3]->sched_date, '16.11.2011', 'fourth result: scheduled date ok');
is($results[3]->sched_time, '09:39', 'fourth result: scheduled time ok');
#is($results[3]->platform, '2', 'fourth result: platform ok');