# Copyright (C) 2007, 2008 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 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 . require 't/test.pl'; package OddMuse; use Test::More tests => 39; add_module('bbcode.pl'); run_tests(split('\n',<<'EOT')); [b]this text is bold[/b] this text is bold [i]this text is italic[/i] this text is italic [u]this text is underlined[/u] this text is underlined [s]this text is deleted[/s] this text is deleted [strike]this text is deleted[/strike] this text is deleted [color=blue]this text is blue[/color] this text is blue [size=+2]this text is two sizes larger than normal[/size] this text is two sizes larger than normal [size=test]this text is two sizes larger than normal[/size] [size=test]this text is two sizes larger than normal[/size] [font=courier]this text is in the courier font[/font] this text is in the courier font [url]yadda [url]yadda [quote]quoted text[/quote]

quoted text

[quote]first paragraph\n\nsecond paragraph[/quote]

first paragraph

second paragraph

[quote]quoted text[/quote]\nmore text

quoted text

more text

[quote]quoted text[/quote]\nmore text\nand some more\n

quoted text

more text and some more

[quote]quoted text[/quote]\n more text

quoted text

more text

[quote]quoted\ntext\n[/quote]\n more text\n

quoted text

more text

[code]monospaced text[/code]
monospaced text
[code]monospaced\n\n text[/code]
monospaced\n\n text
[code]monospaced text[/code]\nmore text
monospaced text

more text

[code]monospaced text[/code]\n more text
monospaced text

more text

[code]monospaced text[/code]\nmore text\nand last line
monospaced text

more text and last line

:) :-) :( :-( 😊 😊 😟 😟 :smile: :happy: :frown: :sad: 😊 😊 😟 😟 foo\n[h1]blarg foo

blarg

foo[h2]blarg[/h2]fnord foo

blarg

fnord

[h3]blarg [i]moo[/i][/h3]

blarg moo

[h5][h6]blarg[/h6]foo
blarg

foo

[center][size=5]The Savage Tides[/size][/center]

The Savage Tides

[left]This is left[/left]

This is left

[right]This is right[/right]

This is right

[list]\n[*]one\n[*]two\n[/list] [quote][list][*]one[*]two[/list][/quote]

[/quote]

[highlight]this text is highlighted[/highlight] this text is highlighted EOT xpath_run_tests(split('\n',<<'EOT')); [url]http://wikipedia.org[/url] //a[@class="url http"][@href="http://wikipedia.org"][text()="http://wikipedia.org"] [url=http://wikipedia.org]Wikipedia[/url] //a[@class="url http"][@href="http://wikipedia.org"][text()="Wikipedia"] [img]http://upload.wikimedia.org/wikipedia/commons/thumb/6/63/Wikipedia-logo.png/150px-Wikipedia-logo.png[/img] //img[@class="url http"][@src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/63/Wikipedia-logo.png/150px-Wikipedia-logo.png"] [H4][url=http://example.org]mu[/url][/h4] //h4/a[@class="url http"][@href="http://example.org"][text()="mu"] EOT add_module('creole.pl'); run_tests(split('\n',<<'EOT')); * [s]this text is deleted[/s] EOT test_page(update_page('test', '[b]Important:[/b]'), 'Important:');