1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- # Copyright (C) 2006 Alex Schroeder <alex@emacswiki.org>
- #
- # 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 3 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, see <http://www.gnu.org/licenses/>.
- require './t/test.pl';
- package OddMuse;
- use Test::More tests => 24;
- add_module('aggregate.pl');
- update_page('InnocentPage', 'We are innocent!');
- update_page('NicePage', 'You are nice.');
- update_page('OtherPage', 'This is off-topic.');
- update_page('Front_Page', q{Hello!
- <aggregate "NicePage" "OtherPage">
- The End.});
- $page = get_page('Front_Page');
- xpath_test($page, '//div[@class="content browse"]/p[text()="Hello! "]',
- '//div[@class="aggregate journal"]/div[@class="page"]/h2/a[@class="local"][text()="NicePage"]',
- '//div[@class="aggregate journal"]/div[@class="page"]/h2/a[@class="local"][text()="OtherPage"]',
- '//div[@class="page"]/p[text()="You are nice."]',
- '//div[@class="page"]/p[text()="This is off-topic."]',
- '//div[@class="content browse"]/p[text()=" The End."]');
- $page = get_page('action=aggregate id=Front_Page');
- test_page($page, '<title>NicePage</title>',
- '<title>OtherPage</title>',
- '<link>http://localhost/wiki.pl/NicePage</link>',
- '<link>http://localhost/wiki.pl/OtherPage</link>',
- '<description><p>You are nice.</p></description>',
- '<description><p>This is off-topic.</p></description>',
- '<wiki:status>new</wiki:status>',
- '<wiki:importance>major</wiki:importance>',
- quotemeta('<wiki:history>http://localhost/wiki.pl?action=history;id=NicePage</wiki:history>'),
- quotemeta('<wiki:diff>http://localhost/wiki.pl?action=browse;diff=1;id=NicePage</wiki:diff>'),
- quotemeta('<wiki:history>http://localhost/wiki.pl?action=history;id=OtherPage</wiki:history>'),
- quotemeta('<wiki:diff>http://localhost/wiki.pl?action=browse;diff=1;id=OtherPage</wiki:diff>'),
- '<title>Wiki: Front Page</title>',
- '<link>http://localhost/wiki.pl/Front_Page</link>',
- );
- # check for infinite loops
- update_page('Front_Page', q{Hello!
- <aggregate search off-topic>
- The End.});
- $page = get_page('Front_Page');
- xpath_test($page, '//div[@class="content browse"]/p[text()="Hello! "]',
- '//div[@class="aggregate journal"]/div[@class="page"]/h2/a[@class="local"][text()="OtherPage"]',
- '//div[@class="page"]/p[text()="This is off-topic."]',
- '//div[@class="content browse"]/p[text()=" The End."]');
|