# 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 => 22;
clear_pages();
add_module('toc.pl');
add_module('usemod.pl');
InitVariables(); # do this after loading usemod.pl!
run_tests(split('\n',<<'EOT'));
== make honey ==\n\nMoo.\n
make honey
Moo.
EOT
test_page(update_page('toc', "bla\n"
. "=one=\n"
. "blarg\n"
. "==two==\n"
. "bla\n"
. "==two==\n"
. "mu."),
quotemeta('- one
- two
- two
'),
quotemeta('one
'),
quotemeta('two
'),
quotemeta('bla
one
'),);
test_page(update_page('toc', "bla\n"
. "==two=\n"
. "bla\n"
. "===three==\n"
. "bla\n"
. "==two==\n"),
quotemeta('- two
- three
- two
'),
quotemeta('two
'),
quotemeta('three
'));
test_page(update_page('toc', "bla\n"
. "\n"
. "murks\n"
. "==two=\n"
. "bla\n"
. "===three==\n"
. "bla\n"
. "=one=\n"),
quotemeta('- two
- three
- one
'),
quotemeta('two
'),
quotemeta('one
'),
quotemeta('bla murks'),);
test_page(update_page('toc', "bla\n"
. "=one=\n"
. "blarg\n"
. "==two==\n"
. "bla\n"
. "==two==\n"
. "mu.\n"
. "bla\n"
. "==two==\n"
. "mu.\n"
. "yadda bla\n"
. "==two==\n"
. "mu.\n"
. "yadda
has no effect! \n"
. "##bla\n"
. "==three==\n"
. "mu.##\n"
. "=one=\n"
. "blarg
\n"),
quotemeta('- one
- two
- three
- one
'),
quotemeta('one
'),
quotemeta('two
'),
quotemeta('three
'),
quotemeta('one
'),);
add_module('markup.pl');
test_page(update_page('toc', "bla\n"
. "=one=\n"
. "blarg\n"
. "bla\n"
. "=two=\n"
. "mu.\n"
. "##bla\n"
. "=three=\n"
. "mu.##\n"
. "=four=\n"
. "blarg\n"),
quotemeta('- one
- four
'),
quotemeta('one
'),
quotemeta('four
'),);