Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Travel-Routing-DE-EFA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
Travel-Routing-DE-EFA
Commits
d2b2f157
Commit
d2b2f157
authored
13 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Re-add VRR.pm setup error tests
parent
d9c788b8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Build.PL
+2
-1
2 additions, 1 deletion
Build.PL
t/20-vrr.t
+47
-58
47 additions, 58 deletions
t/20-vrr.t
with
49 additions
and
59 deletions
Build.PL
+
2
−
1
View file @
d2b2f157
...
...
@@ -7,8 +7,9 @@ use Module::Build;
Module::
Build
->
new
(
build_requires
=>
{
'
Test::More
'
=>
0
,
'
Test::Compile
'
=>
0
,
'
Test::Fatal
'
=>
0
,
'
Test::More
'
=>
0
,
'
Test::Pod
'
=>
0
,
},
module_name
=>
'
Travel::Routing::DE::VRR
',
...
...
This diff is collapsed.
Click to expand it.
t/20-vrr.t
+
47
−
58
View file @
d2b2f157
...
...
@@ -3,7 +3,8 @@ use strict;
use
warnings
;
use
5.010
;
use
Test::
More
tests
=>
59
;
use
Test::
More
tests
=>
67
;
use
Test::
Fatal
;
BEGIN
{
use_ok
('
Travel::Routing::DE::VRR
');
...
...
@@ -58,23 +59,13 @@ sub is_efa_post {
}
sub
is_efa_err
{
my
(
$key
,
$val
,
$str
)
=
@_
;
return
;
# FIXME error handling
my
$efa
=
efa_new
([
$key
,
$val
]);
my
(
$ck
,
$cv
,
$exception
)
=
@_
;
my
$val_want
=
$val
;
if
(
ref
$val
eq
'
ARRAY
')
{
$val_want
=
join
(
q{ }
,
@
{
$val
});
}
is_deeply
(
$efa
->
{'
config
'},
efa_conf
([
$key
,
$val
]),
"
conf ok:
$key
=>
$val
",
isa_ok
(
exception
{
Travel::Routing::DE::
VRR
->
new
(
%
{
efa_conf
([
$ck
,
$cv
])})
},
$exception
,
"
$ck
=>
$cv
"
);
# FIXME actual error tests
}
is_efa_post
('
ignored
',
'
ignored
');
...
...
@@ -109,16 +100,6 @@ is_efa_post(
['
itdTimeMinute
',
'
38
'],
);
is_efa_err
(
'
departure_time
',
'
37:00
',
'
Must match HH:MM
',
);
is_efa_err
(
'
departure_time
',
'
07
',
'
Must match HH:MM
',
);
is_efa_post
(
'
date
',
'
2.10.2009
',
['
itdDateDay
',
'
2
'],
...
...
@@ -133,16 +114,6 @@ is_efa_post(
['
itdDateYear
',
(
localtime
(
time
))[
5
]
+
1900
],
);
is_efa_err
(
'
date
',
'
42.5.2003
',
'
Invalid day
',
);
is_efa_err
(
'
date
',
'
7.
',
'
Invalid month
',
);
is_efa_post
(
'
exclude
',
[
qw[zug]
],
['
inclMOT_0
',
undef
],
...
...
@@ -155,13 +126,6 @@ is_efa_post(
['
inclMOT_10
',
undef
],
);
is_efa_err
(
'
exclude
',
[
qw[sonstige invalid]
],
'
Must consist of
'
.
'
zug s-bahn u-bahn stadtbahn tram stadtbus regionalbus
'
.
'
schnellbus seilbahn schiff ast sonstige
',
);
is_efa_post
(
'
select_interchange_by
',
'
speed
',
['
routeType
',
'
LEASTTIME
'],
...
...
@@ -177,11 +141,6 @@ is_efa_post(
['
routeType
',
'
LEASTWALKING
'],
);
is_efa_err
(
'
select_interchange_by
',
'
invalid
',
'
Must be either speed, nowait or nowalk
',
);
is_efa_post
(
'
train_type
',
'
local
',
['
lineRestriction
',
403
],
...
...
@@ -197,21 +156,11 @@ is_efa_post(
['
lineRestriction
',
400
],
);
is_efa_err
(
'
train_type
',
'
invalid
',
'
Must be one of local/ic/ice
',
);
is_efa_post
(
'
walk_speed
',
'
normal
',
['
changeSpeed
',
'
normal
'],
);
is_efa_err
(
'
walk_speed
',
'
invalid
',
'
Must be normal, fast or slow
',
);
is_efa_post
(
'
max_interchanges
',
5
,
['
maxChanges
',
5
],
...
...
@@ -226,3 +175,43 @@ is_efa_post(
'
with_bike
',
1
,
['
bikeTakeAlong
',
1
],
);
is_efa_err
(
'
departure_time
',
'
37:00
',
'
Travel::Routing::DE::VRR::Exception::Setup
',
);
is_efa_err
(
'
departure_time
',
'
07
',
'
Travel::Routing::DE::VRR::Exception::Setup
',
);
is_efa_err
(
'
train_type
',
'
invalid
',
'
Travel::Routing::DE::VRR::Exception::Setup
',
);
is_efa_err
(
'
walk_speed
',
'
invalid
',
'
Travel::Routing::DE::VRR::Exception::Setup
',
);
is_efa_err
(
'
select_interchange_by
',
'
invalid
',
'
Travel::Routing::DE::VRR::Exception::Setup
',
);
is_efa_err
(
'
exclude
',
[
qw[sonstige invalid]
],
'
Travel::Routing::DE::VRR::Exception::Setup
',
);
is_efa_err
(
'
date
',
'
42.5.2003
',
'
Travel::Routing::DE::VRR::Exception::Setup
',
);
is_efa_err
(
'
date
',
'
7.
',
'
Travel::Routing::DE::VRR::Exception::Setup
',
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment