From aa5098642d7e55d5a9fa83998457d788b71798c0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 6 Jun 2010 18:09:27 +0200 Subject: Detect non-itinerary efa.vrr.de output (i.e. upon invalid input data) --- test/50-efa.t | 10 +- test/dump_invalid_input | 793 +++++++++++++++++++++++++++++++++++++++++++++++ test/parse_invalid_input | 1 + 3 files changed, 803 insertions(+), 1 deletion(-) create mode 100644 test/dump_invalid_input create mode 100644 test/parse_invalid_input (limited to 'test') diff --git a/test/50-efa.t b/test/50-efa.t index 067b70b..ef97fb9 100644 --- a/test/50-efa.t +++ b/test/50-efa.t @@ -3,7 +3,7 @@ use strict; use warnings; use 5.010; -use Test::Command tests => 82; +use Test::Command tests => 85; my $efa = 'bin/efa'; my $testarg = "E HBf MH HBf"; @@ -152,3 +152,11 @@ $cmd = Test::Command->new( $cmd->exit_is_num(2); $cmd->stdout_is_file('test/parse_no_connections'); $cmd->stderr_is_eq($EMPTY); + +$cmd = Test::Command->new( + cmd => "$efa $test_parse < test/dump_invalid_input" +); + +$cmd->exit_is_num(3); +$cmd->stdout_is_file('test/parse_invalid_input'); +$cmd->stderr_is_eq($EMPTY); diff --git a/test/dump_invalid_input b/test/dump_invalid_input new file mode 100644 index 0000000..fbdd3a1 --- /dev/null +++ b/test/dump_invalid_input @@ -0,0 +1,793 @@ + + + +Fahrplanauskunft + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Aushangfahrplan
Abfahrtsmonitor
Persönlicher Fahrplan
Verbundfahrplan Schnellverkehr
Linienplan Schnellverkehr
Stadtlinienpläne
Bedienungshinweise
Bildschirmschoner
Aktuelle Hinweise
Ihr Link zu uns
Impressum
Homepage
+
  + + + + + + + +
+
Fahrplanauskunft
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
*
* von:Stadt/Ort*Essen*
 
*
*Haltestelle*Hauptbahnhof
**
+
+ + + + + +
+ +
+
+
*
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
*
* nach:Stadt/Ort*Düsseldorf*
 
*
*Haltestelle*Hbf
**
+
+ + + + + +
+ +
+
+
*
+
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
*
* Linienauswahl
*
*alle Linien
*alle Linien ohne ICE
*nur Verbund-/Nahverkehrslinien
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
*
* Umsteigen / Fußwege
**
zeitkürzeste Verbindungen
Verbindungen mit wenig Umsteigen
Verbindungen mit kurzen Fußwegen
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
*
 Gehgeschwindigkeit 
**
normal
schnell
langsam
+
*
+ + + + + +
 Berücksichtigung von Nachbarhaltestellen bei Start und Ziel
+
*
+
*
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*
* Zeit:
* Abfahrt*Uhr*Datum
* Ankunft     + + + + + + +
*Uhrzeit unbrauchbar
*
+
*
+ + + + + + + + + + + + + + + + +
*
***
*
+
+
+
*
+
+ +
+ +
+ +
+ +
+
+ + + +
**
+
+
+ + diff --git a/test/parse_invalid_input b/test/parse_invalid_input new file mode 100644 index 0000000..5686f5d --- /dev/null +++ b/test/parse_invalid_input @@ -0,0 +1 @@ +efa.vrr.de returned no connections, check your input data. -- cgit v1.2.3