diff options
Diffstat (limited to 't/git.t')
-rw-r--r-- | t/git.t | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -1,12 +1,14 @@ -# Copyright (C) 2015-2021 all contributors <meta@public-inbox.org> +#!perl -w +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> -use strict; -use Test::More; +use v5.12; use PublicInbox::TestCommon; my ($dir, $for_destroy) = tmpdir(); use PublicInbox::Import; use POSIX qw(strftime); use PublicInbox::Git; +is(PublicInbox::Git::MAX_INFLIGHT, + int(PublicInbox::Git::MAX_INFLIGHT), 'MAX_INFLIGHT is an integer'); { PublicInbox::Import::init_bare($dir, 'master'); @@ -44,7 +46,7 @@ use PublicInbox::Git; my $f = 'HEAD:foo.txt'; my @x = $gcf->check($f); is(scalar @x, 3, 'returned 3 element array for existing file'); - like($x[0], qr/\A[a-f0-9]{40}\z/, 'returns obj ID in 1st element'); + like($x[0], qr/\A[a-f0-9]{40,64}\z/, 'returns obj ID in 1st element'); is('blob', $x[1], 'returns obj type in 2nd element'); like($x[2], qr/\A\d+\z/, 'returns obj size in 3rd element'); @@ -134,7 +136,7 @@ if (1) { } SKIP: { - require_git(2.6, 7) or skip('need git 2.6+ for --batch-all-objects', 7); + require_git(2.6, 7); my ($alt, $alt_obj) = tmpdir(); my $hash_obj = [ 'git', "--git-dir=$alt", qw(hash-object -w --stdin) ]; PublicInbox::Import::init_bare($alt); @@ -202,4 +204,5 @@ is(git_quote($s = "hello\nworld"), '"hello\\nworld"', 'quoted LF'); is(git_quote($s = "hello\x06world"), '"hello\\006world"', 'quoted \\x06'); is(git_unquote($s = '"hello\\006world"'), "hello\x06world", 'unquoted \\x06'); -done_testing(); +diag 'git_version='.sprintf('%vd', PublicInbox::Git::git_version()); +done_testing; |