steffen: server/kolab-horde-framework/kolab-horde-framework/Text_reST/tests headings.phpt, NONE, 1.1 lblocks.phpt, NONE, 1.1 links.phpt, NONE, 1.1 roles.phpt, NONE, 1.1
cvs at intevation.de
cvs at intevation.de
Fri Oct 14 16:33:15 CEST 2005
Author: steffen
Update of /kolabrepository/server/kolab-horde-framework/kolab-horde-framework/Text_reST/tests
In directory doto:/tmp/cvs-serv28903/kolab-horde-framework/kolab-horde-framework/Text_reST/tests
Added Files:
headings.phpt lblocks.phpt links.phpt roles.phpt
Log Message:
Separated Horde Framework from kolab-resource-handlers
--- NEW FILE: headings.phpt ---
--TEST--
Text_reST_Parser:: heading/section parsing
--FILE--
<?php
require_once dirname(__FILE__) . '/../reST.php';
$document = &Text_reST::parse("
===================
Document Title
===================
Here is a paragraph.
Sub-heading 1
-------------
Another paragraph.
Sub-sub-heading 1
^^^^^^^^^^^^^^^^^
another paragraph.
Sub-sub-heading 2
^^^^^^^^^^^^^^^^^
another paragraph.
Sub-heading 2
-------------
another paragraph
");
$document->dump();
--EXPECT--
Document::
Section:: level="1"
Heading:: level="1"
"Document Title"
Paragraph::
"Here is a paragraph."
Section:: level="2"
Heading:: level="2"
"Sub-heading 1"
Paragraph::
"Another paragraph."
Section:: level="3"
Heading:: level="3"
"Sub-sub-heading 1"
Paragraph::
"another paragraph."
Section:: level="3"
Heading:: level="3"
"Sub-sub-heading 2"
Paragraph::
"another paragraph."
Section:: level="2"
Heading:: level="2"
"Sub-heading 2"
Paragraph::
"another paragraph"
--- NEW FILE: lblocks.phpt ---
--TEST--
Text_reST_Parser:: text role parsing
--FILE--
<?php
require_once dirname(__FILE__) . '/../reST.php';
$document = &Text_reST::parse('
::
if ($foo) {
...
}
Here is another paragraph::
while (true) {
}
And another. ::
do {
if (...) {
break;
}
} while (false);
');
$document->dump();
--EXPECT--
Document::
Literal-Block::
"if ($foo) {
...
}"
Paragraph::
"Here is another paragraph:"
Literal-Block::
"while (true) {
}"
Paragraph::
"And another."
Literal-Block::
"do {
if (...) {
break;
}
} while (false);"
--- NEW FILE: links.phpt ---
--TEST--
Text_reST_Parser:: link parsing
--FILE--
<?php
require_once dirname(__FILE__) . '/../reST.php';
$document = &Text_reST::parse("
.. __: http://dev.horde.org/
Test link: http://www.horde.org/. Test email: foo at example.com. An anonymous
link to `Slashdot <http://slashdot.org/>`__. Here's the `Horde dev site`__.
Here's `another link`__.
__ http://example.com/
Here's one for Python_. Here's one for `verified voting`_.
.. _Python: http://www.python.org/
.. _verified voting: http://www.verifiedvoting.org/
Here's a `named email address`_.
.. _named email address: foo at example.com
");
$document->dump();
--EXPECT--
Document::
Paragraph::
"Test link: "
Link:: href="http://www.horde.org/"
"http://www.horde.org/"
". Test email: "
Link:: href="mailto:foo at example.com"
"foo at example.com"
". An anonymous link to "
Link:: href="http://slashdot.org/"
"Slashdot"
". Here's the "
Link:: href="http://dev.horde.org/"
"Horde dev site"
". Here's "
Link:: href="http://example.com/"
"another link"
"."
Paragraph::
"Here's one for "
Link:: href="http://www.python.org/" name="python"
"Python"
". Here's one for "
Link:: href="http://www.verifiedvoting.org/" name="verified voting"
"verified voting"
"."
Paragraph::
"Here's a "
Link:: href="mailto:foo at example.com" name="named email address"
"named email address"
"."
--- NEW FILE: roles.phpt ---
--TEST--
Text_reST_Parser:: text role parsing
--FILE--
<?php
require_once dirname(__FILE__) . '/../reST.php';
$document = &Text_reST::parse("
This is a test paragraph. It has *italics* and **bold**, ``literal text``,
`A title reference` another :title-reference:`title reference`. It has
some :sup:`superscript` and some :sub:`subscript`.
");
$document->dump();
--EXPECT--
Document::
Paragraph::
"This is a test paragraph. It has "
Interpreted-Text:: role="emphasis"
"italics"
" and "
Interpreted-Text:: role="strong"
"bold"
", "
Interpreted-Text:: role="literal"
"literal text"
", "
Interpreted-Text:: role="title-reference"
"A title reference"
" another "
Interpreted-Text:: role="title-reference"
"title reference"
". It has some "
Interpreted-Text:: role="superscript"
"superscript"
" and some "
Interpreted-Text:: role="subscript"
"subscript"
"."
More information about the commits
mailing list