403Webshell
Server IP : 45.40.142.9  /  Your IP : 216.73.216.250
Web Server : Apache
System : Linux s45-40-142-9.secureserver.net 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64
User : bayspec ( 506)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /.cpanm/latest-build/HTTP-Tiny-0.070/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /.cpanm/latest-build/HTTP-Tiny-0.070/t/010_url.t
#!perl

use strict;
use warnings;

use Test::More 0.86;
use HTTP::Tiny;

my @tests = (
    [ 'HtTp://Example.COM/',                 'http',  'example.com',    80, '/', '',          ],
    [ 'HtTp://Example.com:1024/',            'http',  'example.com',  1024, '/', '',          ],
    [ 'http://example.com',                  'http',  'example.com',    80, '/', '',          ],
    [ 'http://example.com:',                 'http',  'example.com',    80, '/', '',          ],
    [ 'http://foo@example.com:',             'http',  'example.com',    80, '/', 'foo',          ],
    [ 'http://foo:pass@example.com:',        'http',  'example.com',    80, '/', 'foo:pass',          ],
    [ 'http://@example.com:',                'http',  'example.com',    80, '/', '',          ],
    [ 'http://example.com?foo=bar',          'http',  'example.com',    80, '/?foo=bar', '',  ],
    [ 'http://example.com?foo=bar#fragment', 'http',  'example.com',    80, '/?foo=bar', '',  ],
    [ 'http://example.com/path?foo=bar',     'http',  'example.com',    80, '/path?foo=bar', '',  ],
    [ 'http:///path?foo=bar',                'http',  'localhost',      80, '/path?foo=bar', '',  ],
    [ 'HTTPS://example.com/',                'https', 'example.com',   443, '/', '',          ],
    [ 'http://[::]:1024',                    'http',  '[::]',         1024, '/', '',          ],
    [ 'xxx://foo/',                          'xxx',   'foo',         undef, '/', '',          ],
);

plan tests => scalar @tests;

for my $test (@tests) {
    my $url = shift(@$test);
    my $got = [ HTTP::Tiny->_split_url($url) ];
    my $exp = $test;
    is_deeply($got, $exp, "->split_url('$url')") or diag explain $got;
}



Youez - 2016 - github.com/yon3zu
LinuXploit