tvl-depot/t/Git-SVN/Utils/collapse_dotdot.t
Vincent Ambo 1b593e1ea4 Squashed 'third_party/git/' content from commit cb71568594
git-subtree-dir: third_party/git
git-subtree-split: cb715685942260375e1eb8153b0768a376e4ece7
2020-01-11 23:36:56 +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";
}