����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
use strict;
use warnings;
use Test::More tests => 37;
use URI ();
my $u = URI->new("", "http");
my @q;
# For tests using array object
{
package
Foo::Bar::Array;
sub new
{
my $this = shift( @_ );
return( bless( ( @_ == 1 && ref( $_[0] || '' ) eq 'ARRAY' ) ? shift( @_ ) : [@_] => ( ref( $this ) || $this ) ) );
}
package
Foo::Bar::Stringy;
push( @Foo::Bar::Stringy::ISA, 'Foo::Bar::Array' );
use overload (
'""' => '_as_string',
);
sub _as_string
{
my $self = shift;
local $" = '_hello_';
return( "@$self" );
}
}
$u->query_form(a => 3, b => 4);
is $u, "?a=3&b=4";
$u->query_form(a => undef);
is $u, "?a";
$u->query_form("a[=&+#] " => " [=&+#]");
is $u, "?a%5B%3D%26%2B%23%5D+=+%5B%3D%26%2B%23%5D";
@q = $u->query_form;
is join(":", @q), "a[=&+#] : [=&+#]";
@q = $u->query_keywords;
ok !@q;
$u->query_keywords("a", "b");
is $u, "?a+b";
$u->query_keywords(" ", "+", "=", "[", "]");
is $u, "?%20+%2B+%3D+%5B+%5D";
@q = $u->query_keywords;
is join(":", @q), " :+:=:[:]";
@q = $u->query_form;
ok !@q;
$u->query(" +?=#");
is $u, "?%20+?=%23";
$u->query_keywords([qw(a b)]);
is $u, "?a+b";
# Same, but using array object
$u->query_keywords(Foo::Bar::Array->new([qw(a b)]));
is $u, "?a+b";
# Same, but using a stringifyable array object
$u->query_keywords(Foo::Bar::Stringy->new([qw(a b)]));
is $u, "?a_hello_b";
$u->query_keywords([]);
is $u, "";
# Same, but using array object
$u->query_keywords(Foo::Bar::Array->new([]));
is $u, "";
# Same, but using a stringifyable array object
$u->query_keywords(Foo::Bar::Stringy->new([]));
is $u, "?";
$u->query_form({ a => 1, b => 2 });
ok $u eq "?a=1&b=2" || $u eq "?b=2&a=1";
$u->query_form([ a => 1, b => 2 ]);
is $u, "?a=1&b=2";
# Same, but using array object
$u->query_form(Foo::Bar::Array->new([ a => 1, b => 2 ]));
is $u, "?a=1&b=2";
$u->query_form({});
is $u, "";
$u->query_form([a => [1..4]]);
is $u, "?a=1&a=2&a=3&a=4";
# Same, but using array object
$u->query_form(Foo::Bar::Array->new([a => [1..4]]));
is $u, "?a=1&a=2&a=3&a=4";
$u->query_form([]);
is $u, "";
# Same, but using array object
$u->query_form(Foo::Bar::Array->new([]));
is $u, "";
# Same, but using a strngifyable array object
$u->query_form(Foo::Bar::Stringy->new([]));
is $u, "";
$u->query_form(a => { foo => 1 });
ok "$u" =~ /^\?a=HASH\(/;
$u->query_form(a => 1, b => 2, ';');
is $u, "?a=1;b=2";
$u->query_form(a => 1, c => 2);
is $u, "?a=1;c=2";
$u->query_form(a => 1, c => 2, '&');
is $u, "?a=1&c=2";
$u->query_form([a => 1, b => 2], ';');
is $u, "?a=1;b=2";
# Same, but using array object
$u->query_form(Foo::Bar::Array->new([a => 1, b => 2]), ';');
is $u, "?a=1;b=2";
# Same, but using a stringifyable array object
$u->query_form("c" => Foo::Bar::Stringy->new([a => 1, b => 2]), "d" => "e", ';');
is $u, "?c=a_hello_1_hello_b_hello_2;d=e";
$u->query_form([]);
{
local $URI::DEFAULT_QUERY_FORM_DELIMITER = ';';
$u->query_form(a => 1, b => 2);
}
is $u, "?a=1;b=2";
# Same, but using array object
$u->query_form(Foo::Bar::Array->new([]));
{
local $URI::DEFAULT_QUERY_FORM_DELIMITER = ';';
$u->query_form(a => 1, b => 2);
}
is $u, "?a=1;b=2";
$u->query('a&b=2');
@q = $u->query_form;
is join(":", map { defined($_) ? $_ : '' } @q), "a::b:2";
ok !defined($q[1]);
$u->query_form(@q);
is $u,'?a&b=2';
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| 00-report-prereqs.dd | File | 3.7 KB | 0644 |
|
| 00-report-prereqs.t | File | 5.88 KB | 0644 |
|
| abs.t | File | 5.44 KB | 0644 |
|
| clone.t | File | 331 B | 0644 |
|
| cwd.t | File | 176 B | 0644 |
|
| data.t | File | 2.28 KB | 0644 |
|
| escape-char.t | File | 613 B | 0644 |
|
| escape.t | File | 2.88 KB | 0644 |
|
| file.t | File | 3.61 KB | 0644 |
|
| ftp.t | File | 803 B | 0644 |
|
| ftpes.t | File | 231 B | 0644 |
|
| ftps.t | File | 230 B | 0644 |
|
| generic.t | File | 3.71 KB | 0644 |
|
| geo_basic.t | File | 1.72 KB | 0644 |
|
| geo_construct.t | File | 2.1 KB | 0644 |
|
| geo_point.t | File | 429 B | 0644 |
|
| gopher.t | File | 1020 B | 0644 |
|
| heuristic.t | File | 3.35 KB | 0644 |
|
| http.t | File | 1.08 KB | 0644 |
|
| icap.t | File | 1.08 KB | 0644 |
|
| idna.t | File | 503 B | 0644 |
|
| ipv6.t | File | 220 B | 0644 |
|
| irc.t | File | 890 B | 0644 |
|
| ircs.t | File | 239 B | 0644 |
|
| iri.t | File | 2.71 KB | 0644 |
|
| ldap.t | File | 2.38 KB | 0644 |
|
| mailto.t | File | 2.34 KB | 0644 |
|
| mix.t | File | 1.44 KB | 0644 |
|
| mms.t | File | 555 B | 0644 |
|
| news.t | File | 1.01 KB | 0644 |
|
| num_eq.t | File | 389 B | 0644 |
|
| old-absconf.t | File | 730 B | 0644 |
|
| old-base.t | File | 34.04 KB | 0644 |
|
| old-file.t | File | 2.71 KB | 0644 |
|
| old-relbase.t | File | 748 B | 0644 |
|
| otpauth.t | File | 8.33 KB | 0644 |
|
| path-segments.t | File | 1000 B | 0644 |
|
| pop.t | File | 828 B | 0644 |
|
| punycode.t | File | 2.22 KB | 0644 |
|
| query-param.t | File | 1.96 KB | 0644 |
|
| query.t | File | 3.29 KB | 0644 |
|
| rel.t | File | 541 B | 0644 |
|
| rfc2732.t | File | 1.86 KB | 0644 |
|
| roy-test.t | File | 936 B | 0644 |
|
| roytest1.html | File | 7.32 KB | 0644 |
|
| roytest2.html | File | 3.56 KB | 0644 |
|
| roytest3.html | File | 3.01 KB | 0644 |
|
| roytest4.html | File | 3.63 KB | 0644 |
|
| roytest5.html | File | 3.28 KB | 0644 |
|
| rsync.t | File | 263 B | 0644 |
|
| rtsp.t | File | 651 B | 0644 |
|
| scheme-exceptions.t | File | 480 B | 0644 |
|
| scp.t | File | 283 B | 0644 |
|
| sftp.t | File | 285 B | 0644 |
|
| sip.t | File | 2.23 KB | 0644 |
|
| smb.t | File | 838 B | 0644 |
|
| smtp.t | File | 954 B | 0644 |
|
| sort-hash-query-form.t | File | 354 B | 0644 |
|
| split.t | File | 994 B | 0644 |
|
| sq-brackets-legacy.t | File | 1.08 KB | 0644 |
|
| sq-brackets.t | File | 8.01 KB | 0644 |
|
| ssh.t | File | 283 B | 0644 |
|
| storable-test.pl | File | 577 B | 0644 |
|
| storable.t | File | 234 B | 0644 |
|
| urn-isbn.t | File | 746 B | 0644 |
|
| urn-oid.t | File | 278 B | 0644 |
|
| urn-scheme-exceptions.t | File | 525 B | 0644 |
|
| userpass.t | File | 429 B | 0644 |
|
| utf8.t | File | 543 B | 0644 |
|
| ws.t | File | 1.06 KB | 0644 |
|