Getopt-Class
view release on metacpan or search on metacpan
t/004_missing.t view on Meta::CPAN
# -*- perl -*-
use Test::More qw( no_plan );
use strict;
use warnings;
use lib './lib';
use Scalar::Util ();
BEGIN { use_ok( 'Getopt::Class' ) || BAIL_OUT( "Unable to load Getopt::Class" ); }
our( $dict, $DEBUG, $VERBOSE, $VERSION, $HELP, $MAN );
require( './t/dictionary.pl' );
# Missing option
{
local @ARGV = qw();
my $opt4 = Getopt::Class->new({
dictionary => $dict,
debug => 0,
});
$opt4->required( [qw( name )] );
my $opts4 = $opt4->exec;
my $missing = $opt4->missing;
is( $missing->[0], 'name', 'Missing check' );
}
( run in 1.037 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )