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
f7b3a08c
Commit
f7b3a08c
authored
14 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for some more options
parent
a41dbb97
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/50-efa.t
+43
-4
43 additions, 4 deletions
test/50-efa.t
with
43 additions
and
4 deletions
test/50-efa.t
+
43
−
4
View file @
f7b3a08c
...
...
@@ -2,14 +2,23 @@
use
strict
;
use
warnings
;
use
5.010
;
use
Test::
Command
tests
=>
15
;
use
Test::
Command
tests
=>
30
;
my
$efa
=
'
bin/efa
';
my
$efa
=
'
bin/efa
';
my
$testarg
=
"
E HBf MH HBf
";
my
$re_usage
=
qr{Insufficient to/from arguments, see \S*efa --help for usage}
;
my
$re_version
=
qr{\S*efa version \S+}
;
my
$err_exclude
=
"
Invalid argument. See manpage for --exclude usage
\n
";
my
$err_prefer
=
"
Invalid argument. Usage: --prefer speed|nowait|nowalk
\n
";
my
$err_include
=
"
Invalid argument. Usage: --include local|ic|ice
\n
";
my
$err_time
=
"
Invalid argument. Usage: --time HH:MM
\n
";
my
$err_date
=
"
Invalid argument: Usage: --date DD.MM[.YYYY]
\n
";
my
$err_walk_speed
=
"
Invalid argument. Uaseg: --walk-speed normal|fast|slow
\n
";
# Usage on invalid invocation
my
$cmd
=
Test::
Command
->
new
(
cmd
=>
"
$efa
");
...
...
@@ -23,19 +32,49 @@ $cmd->exit_isnt_num(0);
$cmd
->
stdout_is_eq
('');
$cmd
->
stderr_like
(
$re_usage
);
$cmd
=
Test::
Command
->
new
(
cmd
=>
"
$efa
E HBf Du HBf MH
");
$cmd
->
exit_isnt_num
(
0
);
$cmd
->
stdout_is_eq
('');
$cmd
->
stderr_like
(
$re_usage
);
$cmd
=
Test::
Command
->
new
(
cmd
=>
"
$efa
--exclude invalid
$testarg
");
$cmd
->
exit_isnt_num
(
0
);
$cmd
->
stdout_is_eq
('');
$cmd
->
stderr_is_eq
(
$err_exclude
);
$cmd
=
Test::
Command
->
new
(
cmd
=>
"
$efa
--prefer invalid
$testarg
");
$cmd
->
exit_isnt_num
(
0
);
$cmd
->
stdout_is_eq
('');
$cmd
->
stderr_is_eq
(
$err_prefer
);
$cmd
=
Test::
Command
->
new
(
cmd
=>
"
$efa
--include invalid
$testarg
");
$cmd
->
exit_isnt_num
(
0
);
$cmd
->
stdout_is_eq
('');
$cmd
->
stderr_is_eq
(
$err_include
);
$cmd
=
Test::
Command
->
new
(
cmd
=>
"
$efa
--walk-speed invalid
$testarg
");
$cmd
->
exit_isnt_num
(
0
);
$cmd
->
stdout_is_eq
('');
$cmd
->
stderr_is_eq
(
$err_walk_speed
);
# (primitive) argument checking for --time
$cmd
=
Test::
Command
->
new
(
cmd
=>
"
$efa
--time 35:12
$testarg
");
$cmd
->
exit_isnt_num
(
0
);
$cmd
->
stdout_is_eq
('');
$cmd
->
stderr_is_eq
(
"
Invalid argument. Usage: --time HH:MM
\n
"
);
$cmd
->
stderr_is_eq
(
$err_time
);
# (primitive) argument checking for --date
$cmd
=
Test::
Command
->
new
(
cmd
=>
"
$efa
--date 11.23.2010
$testarg
");
$cmd
->
exit_isnt_num
(
0
);
$cmd
->
stdout_is_eq
('');
$cmd
->
stderr_is_eq
(
"
Invalid argument: Usage: --date DD.MM[.YYYY]
\n
"
);
$cmd
->
stderr_is_eq
(
$err_date
);
# --version
$cmd
=
Test::
Command
->
new
(
cmd
=>
"
$efa
--version
");
...
...
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