# MediaWiki Parser test cases
# Some taken from http://meta.wikimedia.org/wiki/Parser_testing
# All (C) their respective authors and released under the GPL
#
# The syntax should be fairly self-explanatory.
#
# Currently supported test options:
# One of the following three:
#
# (default) generate HTML output
# pst apply pre-save transform
# msg apply message transform
#
# Plus any combination of these:
#
# cat add category links
# ill add inter-language links
# subpage enable subpages (disabled by default)
# noxml don't check for XML well formdness
# title=[[XXX]] run test using article title XXX
# language=XXX set content language to XXX for this test
# variant=XXX set the variant of language for this test (eg zh-tw)
# disabled do not run test
#
# For testing purposes, temporary articles can created:
# !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
# where '/' denotes a newline.
# This is the standard article assumed to exist.
!! article
Main Page
!! text
blah blah
!! endarticle
!!article
Template:Foo
!!text
FOO
!!endarticle
!! article
Template:Blank
!! text
!! endarticle
!! article
Template:!
!! text
|
!! endarticle
###
### Basic tests
###
!! test
Blank input
!! input
!! result
!! end
!! test
Simple paragraph
!! input
This is a simple paragraph.
!! result
<p>This is a simple paragraph.
</p>
!! end
!! test
Simple list
!! input
* Item 1
* Item 2
!! result
<ul><li> Item 1
</li><li> Item 2
</li></ul>
!! end
!! test
Italics and bold
!! input
* plain
* plain''italic''plain
* plain''italic''plain''italic''plain
* plain'''bold'''plain
* plain'''bold'''plain'''bold'''plain
* plain''italic''plain'''bold'''plain
* plain'''bold'''plain''italic''plain
* plain''italic'''bold-italic'''italic''plain
* plain'''bold''bold-italic''bold'''plain
* plain'''''bold-italic'''italic''plain
* plain'''''bold-italic''bold'''plain
* plain''italic'''bold-italic'''''plain
* plain'''bold''bold-italic'''''plain
* plain l'''italic''plain
* plain l''''bold''' plain
!! result
<ul><li> plain
</li><li> plain<i>italic</i>plain
</li><li> plain<i>italic</i>plain<i>italic</i>plain
</li><li> plain<b>bold</b>plain
</li><li> plain<b>bold</b>plain<b>bold</b>plain
</li><li> plain<i>italic</i>plain<b>bold</b>plain
</li><li> plain<b>bold</b>plain<i>italic</i>plain
</li><li> plain<i>italic<b>bold-italic</b>italic</i>plain
</li><li> plain<b>bold<i>bold-italic</i>bold</b>plain
</li><li> plain<i><b>bold-italic</b>italic</i>plain
</li><li> plain<b><i>bold-italic</i>bold</b>plain
</li><li> plain<i>italic<b>bold-italic</b></i>plain
</li><li> plain<b>bold<i>bold-italic</i></b>plain
</li><li> plain l'<i>italic</i>plain
</li><li> plain l'<b>bold</b> plain
</li></ul>
!! end
###
### <nowiki> test cases
###
!! test
<nowiki> unordered list
!! input
<nowiki>* This is not an unordered list item.</nowiki>
!! result
<p>* This is not an unordered list item.
</p>
!! end
!! test
<nowiki> spacing
!! input
<nowiki>Lorem ipsum dolor
sed abit.
sed nullum.
:and a colon
</nowiki>
!! result
<p>Lorem ipsum dolor
sed abit.
sed nullum.
:and a colon
</p>
!! end
!! test
nowiki 3
!! input
:There is not nowiki.
:There is <nowiki>nowiki</nowiki>.
#There is not nowiki.
#There is <nowiki>nowiki</nowiki>.
*There is not nowiki.
*There is <nowiki>nowiki</nowiki>.
!! result
<dl><dd>There is not nowiki.
</dd><dd>There is nowiki.
</dd></dl>
<ol><li>There is not nowiki.
</li><li>There is nowiki.
</li></ol>
<ul><li>There is not nowiki.
</li><li>There is nowiki.
</li></ul>
!! end
###
### Comments
###
!! test
Comment test 1
!! input
<!-- comment 1 --> asdf
<!-- comment 2 -->
!! result
<pre>asdf
</pre>
!! end
!! test
Comment test 2
!! input
asdf
<!-- comment 1 -->
jkl
!! result
<p>asdf
jkl
</p>
!! end
!! test
Comment test 3
!! input
asdf
<!-- comment 1 -->
<!-- comment 2 -->
jkl
!! result
<p>asdf
jkl
</p>
!! end
!! test
Comment test 4
!! input
asdf<!-- comment 1 -->jkl
!! result
<p>asdfjkl
</p>
!! end
!! test
Comment spacing
!! input
a
<!-- foo --> b <!-- bar -->
c
!! result
<p>a
</p>
<pre> b
</pre>
<p>c
</p>
!! end
!! test
Comment whitespace
!! input
<!-- returns a single newline, not nothing, since the newline after > is not stripped -->
!! result
!! end
!! test
Comment semantics and delimiters
!! input
<!-- --><!----><!-----><!------>
!! result
!! end
!! test
Comment semantics and delimiters, redux
!! input
<!-- In SGML every "foo" here would actually show up in the text -- foo -- bar
-- foo -- funky huh? ... -->
!! result
!! end
!! test
Comment semantics and delimiters: directors cut
!! input
<!-- ... However we like to keep things simple and somewhat XML-ish so we eat
everything starting with < followed by !-- until the first -- and > we see,
that wouldn't be valid XML however, since in XML -- has to terminate a comment
-->-->
!! result
<p>-->
</p>
!! end
!! test
Comment semantics: nesting
!! input
<!--<!-- no, we're not going to do anything fancy here -->-->
!! result
<p>-->
</p>
!! end
!! test
Comment semantics: unclosed comment at end
!! input
<!--This comment will run out to the end of the document
!! result
!! end
!! test
Comment in template title
!! input
{{f<!---->oo}}
!! result
<p>FOO
</p>
!! end
!! test
Comment on its own line post-expand
!! input
a
{{blank}}<!---->
b
!! result
<p>a
</p><p>b
</p>
!! end
###
### Preformatted text
###
!! test
Preformatted text
!! input
This is some
Preformatted text
With ''italic''
And '''bold'''
And a [[Main Page|link]]
!! result
<pre>This is some
Preformatted text
With <i>italic</i>
And <b>bold</b>
And a <a href="/wiki/Main_Page" title="Main Page">link</a>
</pre>
!! end
!! test
<pre> with <nowiki> inside (compatibility with 1.6 and earlier)
!! input
<pre><nowiki>
<b>
<cite>
<em>
</nowiki></pre>
!! result
<pre>
<b>
<cite>
<em>
</pre>
!! end
!! test
Regression with preformatted in <center>
!! input
<center>
Blah
</center>
!! result
<center>
<pre>Blah
</pre>
</center>
!! end
!! test
<pre> with attributes (bug 3202)
!! input
<pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
!! result
<pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
!! end
!! test
<pre> with width attribute (bug 3202)
!! input
<pre width="8">Narrow screen goodies</pre>
!! result
<pre width="8">Narrow screen goodies</pre>
!! end
!! test
<pre> with forbidden attribute (bug 3202)
!! input
<pre width="8" onmouseover="alert(document.cookie)">Narrow screen goodies</pre>
!! result
<pre width="8">Narrow screen goodies</pre>
!! end
!! test
<pre> with forbidden attribute values (bug 3202)
!! input
<pre width="8" style="border-width: expression(alert(document.cookie))">Narrow screen goodies</pre>
!! result
<pre width="8">Narrow screen goodies</pre>
!! end
###
### Definition lists
###
!! test
Simple definition
!! input
; name : Definition
!! result
<dl><dt> name </dt><dd> Definition
</dd></dl>
!! end
!! test
Definition list for indentation only
!! input
: Indented text
!! result
<dl><dd> Indented text
</dd></dl>
!! end
!! test
Definition list with no space
!! input
;name:Definition
!! result
<dl><dt>name</dt><dd>Definition
</dd></dl>
!!end
!! test
Definition list with URL link
!! input
; http://example.com/ : definition
!! result
<dl><dt> <a href="http://example.com/" class="external free" title="http://example.com/" rel="nofollow">http://example.com/</a> </dt><dd> definition
</dd></dl>
!! end
!! test
Definition list with bracketed URL link
!! input
;[http://www.example.com/ Example]:Something about it
!! result
<dl><dt><a href="http://www.example.com/" class="external text" title="http://www.example.com/" rel="nofollow">Example</a></dt><dd>Something about it
</dd></dl>
!! end
!! test
Definition list with wikilink containing colon
!! input
; [[Help:FAQ]]: The least-read page on Wikipedia
!! result
<dl><dt> <a href="/index.php?title=Help:FAQ&action=edit&redlink=1" class="new" title="Help:FAQ (not yet written)">Help:FAQ</a></dt><dd> The least-read p
没有合适的资源?快使用搜索试试~ 我知道了~
mediawiki-1.13.2.tar.gz
需积分: 10 1 下载量 144 浏览量
2008-11-21
10:20:22
上传
评论
收藏 8.63MB GZ 举报
温馨提示
共1350个文件
php:853个
sql:145个
png:83个
信息交流平台,充分体现了用户直接是平等的。
资源推荐
资源详情
资源评论
收起资源包目录
mediawiki-1.13.2.tar.gz (1350个子文件)
printutf8.c 3KB
ChangeLog 1KB
tidy.conf 413B
COPYING 18KB
COPYING 2KB
main.css 27KB
main.css 18KB
main.css 8KB
oldshared.css 8KB
main.css 7KB
commonPrint.css 5KB
shared.css 5KB
rtl.css 4KB
rtl.css 3KB
cologneblue.css 3KB
feed.css 3KB
rtl.css 2KB
diff.css 2KB
wikistandard.css 2KB
IE55Fixes.css 1KB
IE60Fixes.css 1KB
IE60Fixes.css 1KB
IE55Fixes.css 1KB
IE70Fixes.css 1KB
IE50Fixes.css 1KB
common_rtl.css 1KB
IE50Fixes.css 1KB
wikiprintable.css 938B
IEMacFixes.css 782B
nostalgia.css 546B
Opera6Fixes.css 244B
Opera7Fixes.css 207B
KHTMLFixes.css 108B
print.css 100B
quickbar-right.css 66B
quickbar.css 45B
main.css 30B
tree.d 591B
counts.d 391B
apache-ampersand.diff 2KB
Documentation 8KB
Doxyfile 10KB
FAQ 164B
discussionitem_icon.gif 949B
discussionitem_icon.gif 949B
discussionitem_icon.gif 949B
link_icon.gif 942B
link_icon.gif 942B
link_icon.gif 942B
link_icon.gif 942B
user.gif 923B
file_icon.gif 921B
file_icon.gif 921B
file_icon.gif 921B
lock_icon.gif 918B
mail_icon.gif 918B
mail_icon.gif 918B
lock_icon.gif 918B
lock_icon.gif 918B
mail_icon.gif 918B
Zoom_sans.gif 901B
sort_up.gif 881B
sort_down.gif 879B
sort_none.gif 877B
spinner.gif 586B
bullet.gif 50B
bullet.gif 50B
bullet.gif 50B
required.gif 47B
HISTORY 292KB
.htaccess 14B
.htaccess 14B
.htaccess 14B
.htaccess 14B
.htaccess 14B
.htaccess 14B
.htaccess 14B
.htaccess 14B
UtfNormalData.inc 109KB
UtfNormalDataK.inc 108KB
messages.inc 64KB
updaters.inc 59KB
FiveUpgrade.inc 38KB
parserTests.inc 35KB
checkLanguage.inc 16KB
languages.inc 14KB
messageTypes.inc 12KB
userDupes.inc 8KB
backup.inc 8KB
compressOld.inc 8KB
writeMessagesArray.inc 8KB
convertLinks.inc 8KB
rebuildrecentchanges.inc 7KB
rebuildInterwiki.inc 7KB
commandLine.inc 7KB
dumpInterwiki.inc 7KB
userOptions.inc 6KB
Search.inc 5KB
backupPrefetch.inc 5KB
importLogs.inc 4KB
共 1350 条
- 1
- 2
- 3
- 4
- 5
- 6
- 14
资源评论
huhuiling
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功