]> git.ipfire.org Git - thirdparty/git.git/blame - t/Git-SVN/Utils/collapse_dotdot.t
git-svn: factor out _collapse_dotdot function
[thirdparty/git.git] / t / Git-SVN / Utils / collapse_dotdot.t
CommitLineData
280ad88a
MS
1#!/usr/bin/env perl
2
3use strict;
4use warnings;
5
6use Test::More 'no_plan';
7
8use Git::SVN::Utils;
9my $collapse_dotdot = \&Git::SVN::Utils::_collapse_dotdot;
10
11my %tests = (
12 "foo/bar/baz" => "foo/bar/baz",
13 ".." => "..",
14 "foo/.." => "",
15 "/foo/bar/../../baz" => "/baz",
16 "deeply/.././deeply/nested" => "./deeply/nested",
17);
18
19for my $arg (keys %tests) {
20 my $want = $tests{$arg};
21
22 is $collapse_dotdot->($arg), $want, "_collapse_dotdot('$arg') => $want";
23}