about summary refs log tree commit diff
path: root/third_party/git/t/t0202/test.pl
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-09-21T10·03+0300
committerVincent Ambo <mail@tazj.in>2021-09-21T11·29+0300
commit43b1791ec601732ac31195df96781a848360a9ac (patch)
treedaae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/t/t0202/test.pl
parent2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (diff)
chore(3p/git): Unvendor git and track patches instead r/2903
This was vendored a long time ago under the expectation that keeping
it in sync with cgit would be easier this way, but it has proven not
to be a big issue.

On the other hand, a vendored copy of git is an annoying maintenance
burden. It is much easier to rebase the single (dottime) patch that we
have.

This removes the vendored copy of git and instead passes the git
source code to cgit via `pkgs.srcOnly`, which includes the applied
patch so that cgit can continue rendering dottime.

Change-Id: If31f62dea7ce688fd1b9050204e9378019775f2b
Diffstat (limited to 'third_party/git/t/t0202/test.pl')
-rwxr-xr-xthird_party/git/t/t0202/test.pl122
1 files changed, 0 insertions, 122 deletions
diff --git a/third_party/git/t/t0202/test.pl b/third_party/git/t/t0202/test.pl
deleted file mode 100755
index 2cbf7b959073..000000000000
--- a/third_party/git/t/t0202/test.pl
+++ /dev/null
@@ -1,122 +0,0 @@
-#!/usr/bin/perl
-use 5.008;
-use lib (split(/:/, $ENV{GITPERLLIB}));
-use strict;
-use warnings;
-use POSIX qw(:locale_h);
-use Test::More tests => 13;
-use Git::I18N;
-
-my $has_gettext_library = $Git::I18N::__HAS_LIBRARY;
-
-ok(1, "Testing Git::I18N with " .
-	 ($has_gettext_library
-	  ? (defined $Locale::Messages::VERSION
-		 ? "Locale::Messages version $Locale::Messages::VERSION"
-		 # Versions of Locale::Messages before 1.17 didn't have a
-		 # $VERSION variable.
-		 : "Locale::Messages version <1.17")
-	  : "NO Perl gettext library"));
-ok(1, "Git::I18N is located at $INC{'Git/I18N.pm'}");
-
-{
-	my $exports = @Git::I18N::EXPORT;
-	ok($exports, "sanity: Git::I18N has $exports export(s)");
-}
-is_deeply(\@Git::I18N::EXPORT, \@Git::I18N::EXPORT_OK, "sanity: Git::I18N exports everything by default");
-
-# prototypes
-{
-	# Add prototypes here when modifying the public interface to add
-	# more gettext wrapper functions.
-	my %prototypes = (qw(
-		__	$
-		__n	$$$
-		N__	$
-	));
-	while (my ($sub, $proto) = each %prototypes) {
-		is(prototype(\&{"Git::I18N::$sub"}), $proto, "sanity: $sub has a $proto prototype");
-	}
-}
-
-# Test basic passthrough in the C locale
-{
-	local $ENV{LANGUAGE} = 'C';
-	local $ENV{LC_ALL}   = 'C';
-	local $ENV{LANG}     = 'C';
-
-	my ($got, $expect) = (('TEST: A Perl test string') x 2);
-
-	is(__($got), $expect, "Passing a string through __() in the C locale works");
-
-	my ($got_singular, $got_plural, $expect_singular, $expect_plural) =
-		(('TEST: 1 file', 'TEST: n files') x 2);
-
-	is(__n($got_singular, $got_plural, 1), $expect_singular,
-		"Get singular string through __n() in C locale");
-	is(__n($got_singular, $got_plural, 2), $expect_plural,
-		"Get plural string through __n() in C locale");
-
-	is(N__($got), $expect, "Passing a string through N__() in the C locale works");
-}
-
-# Test a basic message on different locales
-SKIP: {
-	unless ($ENV{GETTEXT_LOCALE}) {
-		# Can't reliably test __() with a non-C locales because the
-		# required locales may not be installed on the system.
-		#
-		# We test for these anyway as part of the shell
-		# tests. Skipping these here will eliminate failures on odd
-		# platforms with incomplete locale data.
-
-		skip "GETTEXT_LOCALE must be set by lib-gettext.sh for exhaustive Git::I18N tests", 2;
-	}
-
-	# The is_IS UTF-8 locale passed from lib-gettext.sh
-	my $is_IS_locale = $ENV{is_IS_locale};
-
-	my $test = sub {
-		my ($got, $expect, $msg, $locale) = @_;
-		# Maybe this system doesn't have the locale we're trying to
-		# test.
-		my $locale_ok = setlocale(LC_ALL, $locale);
-		is(__($got), $expect, "$msg a gettext library + <$locale> locale <$got> turns into <$expect>");
-	};
-
-	my $env_C = sub {
-		$ENV{LANGUAGE} = 'C';
-		$ENV{LC_ALL}   = 'C';
-	};
-
-	my $env_is = sub {
-		$ENV{LANGUAGE} = 'is';
-		$ENV{LC_ALL}   = $is_IS_locale;
-	};
-
-	# Translation's the same as the original
-	my ($got, $expect) = (('TEST: A Perl test string') x 2);
-
-	if ($has_gettext_library) {
-		{
-			local %ENV; $env_C->();
-			$test->($got, $expect, "With", 'C');
-		}
-
-		{
-			my ($got, $expect) = ($got, 'TILRAUN: Perl tilraunastrengur');
-			local %ENV; $env_is->();
-			$test->($got, $expect, "With", $is_IS_locale);
-		}
-	} else {
-		{
-			local %ENV; $env_C->();
-			$test->($got, $expect, "Without", 'C');
-		}
-
-		{
-			local %ENV; $env_is->();
-			$test->($got, $expect, "Without", 'is');
-		}
-	}
-}