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/canonicalize_url.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 / canonicalize_url.t` 26 lines ยท 691 bytes Raw Blame History 1 #!/usr/bin/env perl 2 3 # Test our own home rolled URL canonicalizer. Test the private one 4 # directly because we can't predict what the SVN API is doing to do. 5 6 use strict; 7 use warnings; 8 9 use Test::More 'no_plan'; 10 11 use Git::SVN::Utils; 12 my $canonicalize_url = \&Git::SVN::Utils::_canonicalize_url_ourselves; 13 14 my %tests = ( 15 "http://x.com" => "http://x.com", 16 "http://x.com/" => "http://x.com", 17 "http://x.com/foo/bar" => "http://x.com/foo/bar", 18 "http://x.com//foo//bar//" => "http://x.com/foo/bar", 19 "http://x.com/ /%/" => "http://x.com/%20%20/%25", 20 ); 21 22 for my $arg (keys %tests) { 23 my $want = $tests{$arg}; 24 25 is $canonicalize_url->($arg), $want, "canonicalize_url('$arg') => $want"; 26 }