MooX-Options

 view release on metacpan or  search on metacpan

t/23-string_with_zero_value.t  view on Meta::CPAN

#!perl
use strict;
use warnings all => 'FATAL';
use Test::More;

package Foo;
use Moo;
use MooX::Options;
option start_from => ( is => "ro", format => "s" );

package main;
local @ARGV = qw/--start_from 0/;
my $f = Foo->new_with_options;
my $n = $f->start_from;
is $n, 0, 'option with value 0 works';
$n++;
is $n, 1, 'and can be increment';

done_testing;



( run in 0.728 second using v1.01-cache-2.11-cpan-5a3173703d6 )