Subject: | Test error with newer versions of CGI.pm |
Newer versions of CGI.pm (not sure which ones, I'm using 3.25) return
302 Found as the first line of the header when using $cgi->redirect.
Test 6 checks for 302 Moved. This causes the test to fail. Here is a
patch to fix this:
*** test.pl 2007-01-31 20:34:48.000000000 +0000
--- test.pl.old 2007-01-31 20:35:25.000000000 +0000
***************
*** 10,16 ****
}
like($sh->lengthen('http://127.0.0.1/shorten.pl?aa'), qr'a\.com');
like($sh->lengthen('http://127.0.0.1/shorten.pl?a'), qr'A');
! like($sh->redirect('http://127.0.0.1/shorten.pl?aa'), qr'(302
Moved|302 Found)');
like($sh->redirect('http://127.0.0.1/shorten.pl?aaa'), qr'404');
undef $sh;
ok(!ref($sh));
--- 10,16 ----
}
like($sh->lengthen('http://127.0.0.1/shorten.pl?aa'), qr'a\.com');
like($sh->lengthen('http://127.0.0.1/shorten.pl?a'), qr'A');
! like($sh->redirect('http://127.0.0.1/shorten.pl?aa'), qr'302 Moved');
like($sh->redirect('http://127.0.0.1/shorten.pl?aaa'), qr'404');
undef $sh;
ok(!ref($sh));