diff --git a/t/namespaces.t b/t/namespaces.t index 89c93dc6..04713f4a 100644 --- a/t/namespaces.t +++ b/t/namespaces.t @@ -18,7 +18,7 @@ require 't/test.pl'; package OddMuse; -use Test::More tests => 22; +use Test::More tests => 24; clear_pages(); add_module('namespaces.pl'); @@ -37,6 +37,9 @@ test_page(update_page('Test', 'Mooo!', 'muu ns', undef, undef, 'ns=Muu'), test_page(get_page('action=browse id=Test ns=Muu'), 'Wiki Muu: Test', '

Mooo!

'); +update_page('Mu', '#REDIRECT Muu:Mu'); +test_page(get_page('action=browse id=Mu'), + ('Status: 302', 'Location: http://localhost/wiki.pl/Muu/Mu')); test_page(get_page('action=browse id=Test ns=Main'), 'Wiki: Test', '

Muuu!

'); diff --git a/t/redirection.t b/t/redirection.t index ee30d75c..34b6f887 100755 --- a/t/redirection.t +++ b/t/redirection.t @@ -18,7 +18,7 @@ require 't/test.pl'; package OddMuse; -use Test::More tests => 18; +use Test::More tests => 24; clear_pages(); @@ -27,6 +27,10 @@ update_page('John_Coltrane', '#REDIRECT Coltrane'); # no redirect update_page('Sonny_Stitt', '#REDIRECT [[Stitt]]'); # redirect update_page('Keith_Jarret', 'Plays with [[Gary Peacock]]'); # link to perm. anchor update_page('Jack_DeJohnette', 'A friend of [::Gary Peacock]'); # define perm. anchor +update_page('InterMap', ' Rock http://rock.com/', 0, 0, 1); # interlink +update_page('Cannonball_Adderley', '#REDIRECT Rock:Cannonball_Adderley'); +update_page('Cannonball', '#REDIRECT Rock:Cannonball'); +update_page('Adderley', '#REDIRECT [[Rock:Cannonball]]'); test_page(get_page('Miles_Davis'), ('Featuring', 'John Coltrane')); test_page(get_page('John_Coltrane'), ('#REDIRECT Coltrane')); @@ -43,3 +47,9 @@ test_page(update_page('Jack_DeJohnette', 'A friend of Gary Peacock.'), 'A friend of Gary Peacock.'); test_page(get_page('Keith_Jarret'), ('wiki.pl\?action=edit;id=Gary_Peacock')); +test_page(get_page('Cannonball_Adderley'), + ('Status: 302', 'Location: http://rock.com/Cannonball_Adderley')); +test_page(get_page('Cannonball'), + ('Status: 302', 'Location: http://rock.com/Cannonball')); +test_page(get_page('Adderley'), + ('Status: 302', 'Location: http://rock.com/Cannonball'));