From c5e32e4576ee11b7aeff76be8102d6775840b988 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 13 Jun 2020 14:50:50 +0200 Subject: Add tests for DB backend --- t/30-invalid-xml.t | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 t/30-invalid-xml.t (limited to 't/30-invalid-xml.t') diff --git a/t/30-invalid-xml.t b/t/30-invalid-xml.t new file mode 100755 index 0000000..cb83a4c --- /dev/null +++ b/t/30-invalid-xml.t @@ -0,0 +1,21 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.020; + +use utf8; + +use File::Slurp qw(read_file); +use Test::More tests => 1; + +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 invalid input'); -- cgit v1.2.3