tvl-depot/third_party/git/t/Git-SVN/Utils/collapse_dotdot.t
Vincent Ambo 7ef0d62730 merge(third_party/git): Merge squashed git subtree at v2.23.0
Merge commit '1b593e1ea4d2af0f6444d9a7788d5d99abd6fde5' as 'third_party/git'
2020-01-11 23:40:29 +00:00

23 lines
462 B
Perl
Executable file

#!/usr/bin/env perl
use strict;
use warnings;
use Test::More 'no_plan';
use Git::SVN::Utils;
my $collapse_dotdot = \&Git::SVN::Utils::_collapse_dotdot;
my %tests = (
"foo/bar/baz" => "foo/bar/baz",
".." => "..",
"foo/.." => "",
"/foo/bar/../../baz" => "/baz",
"deeply/.././deeply/nested" => "./deeply/nested",
);
for my $arg (keys %tests) {
my $want = $tests{$arg};
is $collapse_dotdot->($arg), $want, "_collapse_dotdot('$arg') => $want";
}