File: userpass.t

package info (click to toggle)
liburi-perl 5.30-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 948 kB
  • sloc: perl: 3,936; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 429 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use warnings;

use Test::More;

use URI;

my $uri = URI->new('rsync://foo:bar@example.com');
like $uri->as_string, qr/foo:bar\@example\.com/, 'userinfo is included';

$uri->password(undef);
like $uri->as_string, qr/foo\@example\.com/, 'set password to undef';

$uri = URI->new('rsync://0:bar@example.com');
$uri->password(undef);
like $uri->as_string, qr/0\@example\.com/, '... also for username "0"';

done_testing;