X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FGitalist.git;a=blobdiff_plain;f=t%2F02git_object.t;h=d05a54c198d2a18b7ed885501e50099debc0b9e4;hp=16521a01d7a044f447f6804a7270f0609400daf2;hb=09717a40ef5a5d43158701e91ead9ac7934880db;hpb=66cb1d5326cc208250ed0eee22f764864ebe6e2e diff --git a/t/02git_object.t b/t/02git_object.t index 16521a0..d05a54c 100644 --- a/t/02git_object.t +++ b/t/02git_object.t @@ -24,7 +24,7 @@ BEGIN { use_ok 'Gitalist::Git::Object::Blob'; use_ok 'Gitalist::Git::Object::Commit'; use_ok 'Gitalist::Git::Object::Tag'; - } +} my $object = Gitalist::Git::Object::Tree->new( repository => $repository, @@ -54,7 +54,7 @@ cmp_deeply $object->pack, { __CLASS__ => 'Gitalist::Git::Repository', description => 'some test repository', is_bare => 1, - last_change => '2009-11-12T19:00:34Z', + last_change => '2011-06-05T23:00:44Z', name => 'repo1', owner => code(\&is_system_account_name), }, @@ -93,7 +93,7 @@ cmp_deeply $obj2->pack, { __CLASS__ => 'Gitalist::Git::Repository', description => 'some test repository', is_bare => 1, - last_change => '2009-11-12T19:00:34Z', + last_change => '2011-06-05T23:00:44Z', name => 'repo1', owner => code(\&is_system_account_name), }, @@ -120,7 +120,7 @@ cmp_deeply $commit_obj->pack, { __CLASS__ => 'Gitalist::Git::Repository', description => 'some test repository', is_bare => 1, - last_change => '2009-11-12T19:00:34Z', + last_change => '2011-06-05T23:00:44Z', name => 'repo1', owner => code(\&is_system_account_name), }, @@ -137,7 +137,7 @@ cmp_deeply $commit_obj->pack, { __CLASS__ => 'Gitalist::Git::Repository', description => 'some test repository', is_bare => 1, - last_change => '2009-11-12T19:00:34Z', + last_change => '2011-06-05T23:00:44Z', name => 'repo1', owner => code(\&is_system_account_name), }, @@ -198,6 +198,19 @@ index 257cc56..5716ca5 100644 'commit_obj->get_patch can return a patchset') or warn("Contents was $contents"); } + +my $blame_this = Gitalist::Git::Object::Commit->new( + repository => $repository, + sha1 => 'd6ddf8b26be63066e01d96a0922c87cd8d6e2270', +); + +{ + local $SIG{ALRM} = sub { die "Regressions suck!" }; + alarm 1; + eval { $blame_this->blame('empty-for-a-reason', $blame_this->sha1) }; + is $@, '', "Silly infinite loop didn't manifest for an empty file."; +} + done_testing; sub is_system_account_name {