GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TEST::URI (3)

.ds Aq ’

NAME

Test::URI - Check Uniform Resource Identifiers

CONTENTS

SYNOPSIS



        use Test::More tests => 5;
        use Test::URI;

        my $uri = http://www.example.com:8080/index.html#name

        uri_scheme_ok( $uri, http );
        uri_host_ok( $uri, www.example.com );
        uri_port_ok( $uri, 8080 );
        uri_path_ok( $uri, /index.html );
        uri_fragment_ok( $uri, name );



DESCRIPTION

Check various parts of Uniform Resource Locators

FUNCTIONS

uri_scheme_ok( STRING|URI, SCHEME ) Ok is the STRING is a valid URI, in any format that URI accepts, and the URI uses the same SCHEME (i.e. protocol: http, ftp, ...). SCHEME is not case sensitive.

STRING can be an URI object.

uri_host_ok( STRING|URI, HOST ) Ok is the STRING is a valid URI, in any format that URI accepts, and the URI uses the same HOST. HOST is not case sensitive.

Not Ok is the URI scheme does not have a host portion.

STRING can be an URI object.

uri_port_ok( STRING|URI, PORT ) Ok is the STRING is a valid URI, in any format that URI accepts, and the URI uses the same PORT.

Not Ok is the URI scheme does not have a port portion.

STRING can be an URI object.

uri_canonical_ok UNIMPLEMENTED. I’m not sure why I thought this should be a test. If anyone else knows, I’ll implement it.
uri_path_ok( STRING|URI, PATH ) Ok is the STRING is a valid URI, in any format that URI accepts, and the URI has the path PATH. Remember that paths start with a /, even if it doesn’t look like there is anything after the host parts.

STRING can be an URI object.

uri_fragment_ok( STRING|URI, FRAGMENT ) Ok is the STRING is a valid URI, in any format that URI accepts, and the URI has the fragment FRAGMENT.

STRING can be an URI object.

TO DO

o add methods: uri_canonical_ok, uri_query_string_ok
o add convenience methods such as uri_is_web, uri_is_ftp

SOURCE AVAILABILITY

This source is in GitHub



        https://github.com/briandfoy/Test-URI



AUTHOR

brian d foy, <bdfoy@cpan.org>

COPYRIGHT AND LICENSE

Copyright X 2004-2016, brian d foy <bdfoy@cpan.org>. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TEST::URI (3) 2016-01-25

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.