The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

use strict;
use URI;
my %tests = (
=> '/Protocols/rfc2616/rfc2616-sec5.html?foo=bar#sec5.1.2',
'/Protocols/rfc2616/rfc2616-sec5.html?foo=bar#sec5.1.2',
'/Protocols/rfc2616/rfc2616-sec5.html?foo=bar#sec5.1.2',
);
plan tests => scalar keys %tests;
while ( my ( $in, $expected ) = each %tests ) {
my $out = HTTP::Async::_strip_host_from_uri( URI->new($in) );
is $out, $expected, "correctly stripped $in to $out";
}