diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2023-12-02 16:59:13 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2023-12-02 16:59:13 +0100 |
commit | 760af08f4a9997f8d30ccd6b93380d0c581fbcb5 (patch) | |
tree | c830468fa9e959976bb5326d5a96e2e08d4ddcea /t | |
parent | 7a0e702c107387754e10494eabf8205a408c01d3 (diff) |
Stop, Result: Replace date/time string accessors with datetime instances
Diffstat (limited to 't')
-rw-r--r-- | t/20-vrr.t | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -27,17 +27,17 @@ my @results = $status->results; for my $result (@results) { isa_ok($result, 'Travel::Status::DE::EFA::Result'); - can_ok($result, qw(date destination info line time type platform)); + can_ok($result, qw(datetime destination info line type platform sched_datetime)); } is($results[0]->destination, 'Düsseldorf Hbf', 'first result: destination ok'); is($results[0]->info, 'Bordrestaurant', 'first result: no info'); is($results[0]->line, 'ICE 946 Intercity-Express', 'first result: line ok'); -is($results[0]->date, '16.11.2011', 'first result: real date ok'); -is($results[0]->time, '09:40', 'first result: real time ok'); +is($results[0]->datetime->strftime('%d.%m.%Y'), '16.11.2011', 'first result: real date ok'); +is($results[0]->datetime->strftime('%H:%M'), '09:40', 'first result: real time ok'); is($results[0]->delay, 4, 'first result: delay 4'); -is($results[0]->sched_date, '16.11.2011', 'first result: scheduled date ok'); -is($results[0]->sched_time, '09:36', 'first result: scheduled time ok'); +is($results[0]->sched_datetime->strftime('%d.%m.%Y'), '16.11.2011', 'first result: scheduled date ok'); +is($results[0]->sched_datetime->strftime('%H:%M'), '09:36', 'first result: scheduled time ok'); is($results[0]->mot_name, 'zug', 'first result: mot_name ok'); #is($results[0]->platform, '1', 'first result: platform ok'); #is($results[0]->platform_db, 1, 'first result: platform_db ok'); @@ -45,11 +45,11 @@ is($results[0]->mot_name, 'zug', 'first result: mot_name ok'); is($results[3]->destination, 'Mülheim Heißen Kirche', 'fourth result: destination ok'); is($results[3]->info, 'Ab (H) Heißen Kirche, Umstieg in den SEV Ri. Mülheim Hbf.', 'fourth result: no info'); 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]->datetime->strftime('%d.%m.%Y'), '16.11.2011', 'fourth result: real date ok'); +is($results[3]->datetime->strftime('%H:%M'), '09:39', 'fourth result: real time ok'); 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]->sched_datetime->strftime('%d.%m.%Y'), '16.11.2011', 'fourth result: scheduled date ok'); +is($results[3]->sched_datetime->strftime('%H:%M'), '09:39', 'fourth result: scheduled time ok'); is($results[3]->mot_name, 'u-bahn', 'fourth result: mot_name ok'); #is($results[3]->platform, '2', 'fourth result: platform ok'); #is($results[3]->platform_db, 0, 'fourth result: platform_db ok'); @@ -58,10 +58,10 @@ is($results[-1]->destination, 'Hamm (Westf)', 'last result: destination ok'); is($results[-1]->info, 'Fahrradmitnahme begrenzt möglich', 'last result: info ok'); is($results[-1]->delay, 12, 'last result: delay 12'); is($results[-1]->line, 'RE1', 'last result: line ok'); -is($results[-1]->date, '16.11.2011', 'last result: date ok'); -is($results[-1]->time, '10:05', 'last result: time ok'); -is($results[-1]->sched_date, '16.11.2011', 'first result: scheduled date ok'); -is($results[-1]->sched_time, '09:53', 'last result: scheduled time ok'); +is($results[-1]->datetime->strftime('%d.%m.%Y'), '16.11.2011', 'last result: date ok'); +is($results[-1]->datetime->strftime('%H:%M'), '10:05', 'last result: time ok'); +is($results[-1]->sched_datetime->strftime('%d.%m.%Y'), '16.11.2011', 'first result: scheduled date ok'); +is($results[-1]->sched_datetime->strftime('%H:%M'), '09:53', 'last result: scheduled time ok'); is($results[-1]->mot_name, 'zug', 'last result: mot_name ok'); #is($results[-1]->platform, '6', 'last result: platform ok'); #is($results[-1]->platform_db, 1, 'last result: platform ok'); |