summaryrefslogtreecommitdiff
path: root/t/30-invalid-xml.t
blob: 4a358a2ae433b2117263fd12b1cbabdb662b86e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env perl
use strict;
use warnings;
use 5.020;

use utf8;

use File::Slurp qw(read_file);
use Test::More tests => 2;

use Travel::Status::DE::HAFAS;

my $xml = 'lol';

my $status = Travel::Status::DE::HAFAS->new(
	service => 'DB',
	station => 'Berlin Jannowitzbrücke',
	xml     => $xml
);

is( scalar $status->results,
	0, 'no results on valid XML with invalid HAFAS data' );

$xml = 'lol<';

$status = Travel::Status::DE::HAFAS->new(
	service => 'DB',
	station => 'Berlin Jannowitzbrücke',
	xml     => $xml
);

is( scalar $status->results, 0, 'no results on invalid XML' );