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/add_path_to_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 / add_path_to_url.t` 27 lines ยท 704 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 qw( 9 add_path_to_url 10 ); 11 12 # A reference cannot be a hash key, so we use an array. 13 my @tests = ( 14 ["http://x.com", "bar"] => 'http://x.com/bar', 15 ["http://x.com", ""] => 'http://x.com', 16 ["http://x.com/foo/", undef] => 'http://x.com/foo/', 17 ["http://x.com/foo/", "/bar/baz/"] => 'http://x.com/foo/bar/baz/', 18 ["http://x.com", 'per%cent'] => 'http://x.com/per%25cent', 19 ); 20 21 while(@tests) { 22 my($have, $want) = splice @tests, 0, 2; 23 24 my $args = join ", ", map { qq['$_'] } map { defined($_) ? $_ : 'undef' } @$have; 25 my $name = "add_path_to_url($args) eq $want"; 26 is add_path_to_url(@$have), $want, $name; 27 }