Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
denishowe committed Jun 2, 2024
1 parent ad32fb5 commit 7c62628
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions t/basic.t
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
use TAP::Harness;
use Test::More tests => 22;
use Test::More tests => 24;
use lib "../lib";
use Test::Web; # C:/Strawberry/perl/site/lib
use Test::Web; # ~/Projects/Perl/Test

# Windows: run under cmd, not bash
# cpan install TAP::Harness
# cd foldoc && prove

$ENV{RUN}++ or TAP::Harness->new->runtests(<*.t>);

my $origin = "http://foldoc.org";
my $t = Test::Web->new(url => $origin);
my $t = Test::Web->new(url => "http://foldoc.org");

# Home

my $home = "https://foldoc.org";
$t->redirects('/', "$home/", "Redirect HTTP to HTTPS");

$t = Test::Web->new(url => $home);

$t->get_ok("/")->contains("<title>FOLDOC - Computing Dictionary</title>", "Home title");

# Dangling cross-reference
Expand All @@ -38,7 +43,7 @@ $t->get_ok("/?query=foo&action=Search", "legacy query param", 301)
->header_is(Location => $t->absolute("/foo"), "Query param redirect");

# Test: http://foldoc.org//Fairchild
$t->get_ok("//Fairchild", "Query starts with /");
$t->redirects("//Fairchild", "/Fairchild", "Query starts with /");

# Test: http://foldoc.org/%2fdev%2fnull

Expand Down

0 comments on commit 7c62628

Please sign in to comment.