Skip Menu |
 

This queue is for tickets about the URI CPAN distribution.

Report information
The Basics
Id: 29211
Status: resolved
Priority: 0/
Queue: URI

People
Owner: Nobody in particular
Requestors: geoff [...] laxan.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.35
Fixed in: (no value)



Subject: [PATCH] add some tests for gopher URIs
Download (untitled) / with headers
text/plain 268b
Here are some tests I wrote for the URI::gopher module to help in porting to Lua. They don't test everything, and I don't know anything about Gopher so I can't be sure they're correct, but they might be nice to have if someone ever wants to tweak the gopher.pm code.
Subject: gopher.t
Download gopher.t
text/x-perl 1.1k
#!perl -w use strict; print "1..48\n"; use URI; my $t = 1; sub is { my ($exp, $got) = @_; if (!defined $exp) { print "not " if defined $got; } else { print "not " unless $got eq $exp; } print "ok " . ($t++) . "\n"; } sub check_gopher_uri { my ($u, $exphost, $expport, $exptype, $expselector, $expsearch) = @_; is("gopher", $u->scheme); is($exphost, $u->host); is($expport, $u->port); is($exptype, $u->gopher_type); is($expselector, $u->selector); is($expsearch, $u->search); } my $u; $u = URI->new("gopher://host"); check_gopher_uri($u, "host", 70, 1); $u = URI->new("gopher://host:70"); check_gopher_uri($u, "host", 70, 1); $u = URI->new("gopher://host:70/"); check_gopher_uri($u, "host", 70, 1); $u = URI->new("gopher://host:70/1"); check_gopher_uri($u, "host", 70, 1); $u = URI->new("gopher://host:70/1"); check_gopher_uri($u, "host", 70, 1); $u = URI->new("gopher://host:123/7foo"); check_gopher_uri($u, "host", 123, 7, "foo"); $u = URI->new("gopher://host/7foo\tbar%20baz"); check_gopher_uri($u, "host", 70, 7, "foo", "bar baz"); $u = URI->new("gopher://host/7foo%09bar%20baz"); check_gopher_uri($u, "host", 70, 7, "foo", "bar baz");
Thanks. Applied.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.