ARGV-Struct
view release on metacpan or search on metacpan
0.01 2015-01-27 00:30:00
- First version
0.02 2015-02-04 21:30:00
- Breakage: now the arguments are JSONY compatible
(thanks to Matt S Trout for the suggestion)
- Refactor parsing code
- Better errors
- More tests
0.03 2015-08-05 23:45:00
- Compatibility with pre 5.14 Perls (GH Issue #1)
0.04 2018-09-18 22:33:00
- Migrate to Moo and Type::Tiny
0.05 2018-09-18 23:10:00
- Changes to dist.ini resulted in Makefile.PL not being generated
0.06 2018-11-28 23:00:00
- bin/argvstruct wasn't getting the correct shebang after installation (toddr)
META.yml
Makefile
Makefile.PL
README.md
bin/argvstruct
cpanfile
dist.ini
lib/ARGV/Struct.pm
t/01_load.t
t/03_conformance.t
t/04_errors.t
t/pod.t
t/04_errors.t view on Meta::CPAN
#!/usr/bin/env perl
use Test::More;
use Test::Exception;
use ARGV::Struct;
my @tests = (
{ argv => [ qw/{/ ],
error => 'Unclosed hash',
},
{ argv => [ qw/{ X=Y Y={/ ],
error => 'Unclosed hash',
},
{ argv => [ qw/[/ ],
error => 'Unclosed list',
},
{ argv => [ qw/{ X: X X: Y }/ ],
error => 'Repeated'
},
{ argv => [ qw/[ A B ] Trail/],
error => 'Trailing'
},
{ argv => [ qw/{ 3 /],
error => 'Key 3 doesn\'t',
},
{ argv => [ qw/{ X }/],
},
{ argv => [ qw/{ X: }/ ],
},
);
foreach $test (@tests) {
$test->{ error } = '.+' if (not defined $test->{ error });
throws_ok(
sub { ARGV::Struct->new(argv => $test->{ argv })->parse },
qr/$test->{ error }/,
"Conformance of " . join ' ', @{ $test->{ argv } }
);
}
done_testing;
( run in 0.498 second using v1.01-cache-2.11-cpan-74e6d1fb12f )