Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/Git-SVN/Utils/collapse_dotdot.t # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / Git-SVN / Utils / collapse_dotdot.t` 23 lines ยท 462 bytes Raw Blame History 1 #!/usr/bin/env perl 2 3 use strict; 4 use warnings; 5 6 use Test::More 'no_plan'; 7 8 use Git::SVN::Utils; 9 my $collapse_dotdot = \&Git::SVN::Utils::_collapse_dotdot; 10 11 my %tests = ( 12 "foo/bar/baz" => "foo/bar/baz", 13 ".." => "..", 14 "foo/.." => "", 15 "/foo/bar/../../baz" => "/baz", 16 "deeply/.././deeply/nested" => "./deeply/nested", 17 ); 18 19 for my $arg (keys %tests) { 20 my $want = $tests{$arg}; 21 22 is $collapse_dotdot->($arg), $want, "_collapse_dotdot('$arg') => $want"; 23 }