Help language development. Donate to The Perl Foundation

LibGit2 cpan:CTILMES last updated on 2020-08-18

t/12-signature.t
use Test;
use LibGit2;

plan 11;

ok my $sig = Git::Signature.new('John Doe <[email protected]> 1517452791 -0500'),
    'new from buffer';

is $sig.name, 'John Doe', 'name';
is $sig.email, '[email protected]', 'email';
is $sig.when, DateTime.new('2018-01-31T21:39:51-05:00'), 'when';


ok $sig = Git::Signature.new('Jane Roe', '[email protected]'), 'new now';

is $sig.name, 'Jane Roe', 'name';
is $sig.email, '[email protected]', 'email';


ok $sig = Git::Signature.new('Fred Smith', '[email protected]',
                             DateTime.new('2018-01-31T21:39:51-05:00')),
    'new';

is $sig.name, 'Fred Smith', 'name';
is $sig.email, '[email protected]', 'email';
is $sig.when, DateTime.new('2018-01-31T21:39:51-05:00'), 'when';

done-testing;