From 17e78fbbca316d13cc25957f0286bccfcf1fbdca Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Fri, 22 Dec 2006 15:25:58 +0000 Subject: [PATCH] Initial set of tests. --- t/namespaces.t | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 t/namespaces.t diff --git a/t/namespaces.t b/t/namespaces.t new file mode 100644 index 00000000..cbb5556a --- /dev/null +++ b/t/namespaces.t @@ -0,0 +1,51 @@ +# Copyright (C) 2006 Alex Schroeder +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc. +# 59 Temple Place, Suite 330 +# Boston, MA 02111-1307 USA + +require 't/test.pl'; +package OddMuse; +use Test::More tests => 10; +clear_pages(); + +add_module('namespaces.pl'); + +test_page(get_page('Test'), + 'Wiki: Test', + 'Status: 404 NOT FOUND'); +test_page(update_page('Test', 'Muuu!', 'main ns'), + '

Muuu!

'); +test_page(get_page('action=browse id=Test ns=Muu'), + 'Wiki Muu: Test', + 'Status: 404 NOT FOUND'); +test_page(update_page('Test', 'Mooo!', 'muu ns', undef, undef, 'ns=Muu'), + 'Wiki Muu: Test', + '

Mooo!

'); +test_page(get_page('action=browse id=Test ns=Muu'), + 'Wiki Muu: Test', + '

Mooo!

'); +test_page(get_page('action=browse id=Test ns=Main'), + 'Wiki: Test', + '

Muuu!

'); +test_page(get_page('action=rc raw=1'), + 'description: main ns', + 'description: muu ns'); +test_page_negative(get_page('action=rc raw=1 local=1'), + 'description: muu ns'); +test_page(get_page('action=rc raw=1 ns=Muu'), + 'description: muu ns'); +test_page_negative(get_page('action=rc raw=1 ns=Muu'), + 'description: main ns');