BbcodeAndHtmlTest.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Markup
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. if (!defined("PHPUnit_MAIN_METHOD")) {
  23. define("PHPUnit_MAIN_METHOD", "Zend_Markup_BbcodeAndHtmlTest::main");
  24. }
  25. require_once 'Zend/Markup.php';
  26. require_once 'Zend/Filter/StringToUpper.php';
  27. /**
  28. * @category Zend
  29. * @package Zend_Markup
  30. * @subpackage UnitTests
  31. * @group Zend_Markup
  32. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  33. * @license http://framework.zend.com/license/new-bsd New BSD License
  34. */
  35. class Zend_Markup_BbcodeAndHtmlTest extends PHPUnit_Framework_TestCase
  36. {
  37. /**
  38. * Zend_Markup_Renderer_RendererAbstract instance
  39. *
  40. * @var Zend_Markup_Renderer_RendererAbstract
  41. */
  42. protected $_markup;
  43. /**
  44. * Runs the test methods of this class.
  45. *
  46. * @return void
  47. */
  48. public static function main()
  49. {
  50. $suite = new PHPUnit_Framework_TestSuite("Zend_Markup_MarkupTest");
  51. $result = PHPUnit_TextUI_TestRunner::run($suite);
  52. }
  53. /**
  54. * Sets up the fixture
  55. * This method is called before a test is executed.
  56. *
  57. * @return void
  58. */
  59. public function setUp()
  60. {
  61. $this->_markup = Zend_Markup::factory('bbcode', 'html');
  62. }
  63. /**
  64. * Tears down the fixture
  65. * This method is called after a test is executed.
  66. *
  67. * @return void
  68. */
  69. public function tearDown()
  70. {
  71. unset($this->_markup);
  72. }
  73. /**
  74. * Test for basic tags
  75. *
  76. * @return void
  77. */
  78. public function testBasicTags()
  79. {
  80. $this->assertEquals('<strong>foo</strong>bar', $this->_markup->render('[b]foo[/b]bar'));
  81. $this->assertEquals('<strong>foo<em>bar</em>foo</strong>ba[r',
  82. $this->_markup->render('[b=test file="test"]foo[i hell=nice]bar[/i]foo[/b]ba[r'));
  83. }
  84. /**
  85. * Test the behaviour of complicated tags
  86. *
  87. * @return void
  88. */
  89. public function testComplicatedTags()
  90. {
  91. $this->assertEquals('<a href="http://framework.zend.com/">http://framework.zend.com/</a>',
  92. $this->_markup->render('[url]http://framework.zend.com/[/url]'));
  93. $this->assertEquals('<a href="http://framework.zend.com/">foo</a>',
  94. $this->_markup->render('[url=http://framework.zend.com/]foo[/url]'));
  95. $this->assertEquals('bar', $this->_markup->render('[url="javascript:alert(1)"]bar[/url]'));
  96. $this->assertEquals('<img src="http://framework.zend.com/images/logo.png" alt="logo" />',
  97. $this->_markup->render('[img]http://framework.zend.com/images/logo.png[/img]'));
  98. $this->assertEquals('<img src="http://framework.zend.com/images/logo.png" alt="Zend Framework" />',
  99. $this->_markup->render('[img alt="Zend Framework"]http://framework.zend.com/images/logo.png[/img]'));
  100. }
  101. /**
  102. * Test input exceptions
  103. *
  104. * @return void
  105. */
  106. public function testExceptionParserWrongInputType()
  107. {
  108. $this->setExpectedException('Zend_Markup_Parser_Exception');
  109. $this->_markup->getParser()->parse(array());
  110. }
  111. /**
  112. * Test exception
  113. *
  114. * @return void
  115. */
  116. public function testExceptionParserEmptyInput()
  117. {
  118. $this->setExpectedException('Zend_Markup_Parser_Exception');
  119. $this->_markup->getParser()->parse('');
  120. }
  121. /**
  122. * Test adding tags
  123. *
  124. * @return void
  125. */
  126. public function testAddTags()
  127. {
  128. $this->_markup->getPluginLoader()->addPrefixPath(
  129. 'Zend_Markup_Test_Renderer_Html',
  130. 'Zend/Markup/Test/Renderer/Html'
  131. );
  132. $this->_markup->addMarkup('bar',
  133. Zend_Markup_Renderer_RendererAbstract::TYPE_CALLBACK,
  134. array('group' => 'inline'));
  135. $this->_markup->addMarkup('suppp',
  136. Zend_Markup_Renderer_RendererAbstract::TYPE_REPLACE,
  137. array('start' => '<sup>', 'end' => '</sup>', 'group' => 'inline'));
  138. $this->_markup->addMarkup('zend',
  139. Zend_Markup_Renderer_RendererAbstract::TYPE_REPLACE,
  140. array('replace' => 'Zend Framework', 'group' => 'inline', 'empty' => true));
  141. $this->_markup->addMarkup('line', Zend_Markup_Renderer_RendererAbstract::TYPE_ALIAS,
  142. array('name' => 'hr'));
  143. $this->assertEquals('[foo=blaat]hell<sup>test</sup>blaat[/foo]',
  144. $this->_markup->render('[bar="blaat"]hell[suppp]test[/suppp]blaat[/]'));
  145. $this->assertEquals('Zend Framework', $this->_markup->render('[zend]'));
  146. $this->assertEquals('<hr />', $this->_markup->render('[line]'));
  147. $this->assertEquals('<sup>test aap</sup>test',
  148. $this->_markup->render('[suppp]test aap[/suppp]test'));
  149. }
  150. public function testHtmlUrlTitleIsRenderedCorrectly()
  151. {
  152. $this->assertEquals(
  153. '<a href="http://exampl.com" title="foo">test</a>',
  154. $this->_markup->render('[url=http://exampl.com title=foo]test[/url]')
  155. );
  156. }
  157. public function testValueLessAttributeDoesNotThrowNotice()
  158. {
  159. // Notice: Uninitialized string offset: 42
  160. // in Zend/Markup/Parser/Bbcode.php on line 316
  161. $expected = '<a href="http://example.com">Example</a>';
  162. $value = '[url=http://example.com foo]Example[/url]';
  163. $this->assertEquals($expected, $this->_markup->render($value));
  164. }
  165. public function testAttributeNotEndingValueDoesNotThrowNotice()
  166. {
  167. // Notice: Uninitialized string offset: 13
  168. // in Zend/Markup/Parser/Bbcode.php on line 337
  169. $this->_markup->render('[url=http://framework.zend.com/ title="');
  170. }
  171. public function testAttributeFollowingValueDoesNotThrowNotice()
  172. {
  173. // Notice: Uninitialized string offset: 38
  174. // in Zend/Markup/Parser/Bbcode.php on line 337
  175. $this->_markup->render('[url="http://framework.zend.com/"title');
  176. }
  177. public function testHrTagWorks()
  178. {
  179. $this->assertEquals('foo<hr />bar', $this->_markup->render('foo[hr]bar'));
  180. }
  181. public function testFunkyCombos()
  182. {
  183. $expected = '<span style="text-decoration: underline;">a[/b][hr]b'
  184. . '<strong>c</strong></span><strong>d</strong>[/u]e';
  185. $outcome = $this->_markup->render('[u]a[/b][hr]b[b]c[/u]d[/b][/u]e');
  186. $this->assertEquals($expected, $outcome);
  187. }
  188. public function testImgSrcsConstraints()
  189. {
  190. $this->assertEquals('F/\!ZLrFz',$this->_markup->render('F[img]/\!ZLrFz[/img]'));
  191. }
  192. public function testColorConstraintsAndJs()
  193. {
  194. $input = "<kokx> i think you mean? [color=\"onclick='foobar();'\"]your text[/color] DASPRiD";
  195. $expected = "&lt;kokx&gt; i think you mean? <span>your text</span> DASPRiD";
  196. $this->assertEquals($expected, $this->_markup->render($input));
  197. }
  198. public function testNeverEndingAttribute()
  199. {
  200. $input = "[color=\"green]your text[/color]";
  201. $expected = '<span>your text</span>';
  202. $this->assertEquals($expected, $this->_markup->render($input));
  203. }
  204. public function testTreatmentNonTags()
  205. {
  206. $input = '[span][acronym][h1][h2][h3][h4][h5][h6][nothing]'
  207. . '[/h6][/h5][/h4][/h3][/h2][/h1][/acronym][/span]';
  208. $expected = '<span><acronym><h1><h2><h3><h4><h5><h6>[nothing]'
  209. . '</h6></h5></h4></h3></h2></h1></acronym></span>';
  210. $this->assertEquals($expected, $this->_markup->render($input));
  211. }
  212. public function testListItems()
  213. {
  214. $input = "[list][*]Foo*bar (item 1)\n[*]Item 2\n[*]Trimmed (Item 3)\n[/list]";
  215. $expected = "<ul><li>Foo*bar (item 1)</li><li>Item 2</li><li>Trimmed (Item 3)</li></ul>";
  216. $this->assertEquals($expected, $this->_markup->render($input));
  217. $this->assertEquals('<ul><li>blaat</li></ul>', $this->_markup->render('[list][*]blaat[/*][/list]'));
  218. }
  219. public function testListDisallowingPlaintext()
  220. {
  221. $input = "[list]\ntest[*]Foo[/*]\n[/list]";
  222. $expected = "<ul><li>Foo</li></ul>";
  223. $this->assertEquals($expected, $this->_markup->render($input));
  224. }
  225. public function testFailureAfterCodeTag()
  226. {
  227. $input = "[code][b][/code][list][*]Foo[/*][/list]";
  228. $expected = "<code><span style=\"color: #000000\">\n[b]</span>\n</code><ul><li>Foo</li></ul>";
  229. $this->assertEquals($expected, $this->_markup->render($input));
  230. }
  231. public function testInvalidationAfterInvalidTag()
  232. {
  233. $input = "[b][list][*]Foo[/*][/list][/b]";
  234. $expected = "<strong>[list][*]Foo[/*][/list]</strong>";
  235. $this->assertEquals($expected, $this->_markup->render($input));
  236. }
  237. public function testListTypes()
  238. {
  239. $types = array(
  240. '01' => 'decimal-leading-zero',
  241. '1' => 'decimal',
  242. 'i' => 'lower-roman',
  243. 'I' => 'upper-roman',
  244. 'a' => 'lower-alpha',
  245. 'A' => 'upper-alpha',
  246. 'alpha' => 'lower-greek'
  247. );
  248. foreach ($types as $type => $style) {
  249. $input = "[list={$type}][*]Foobar\n[*]Zend\n[/list]";
  250. $expected = "<ol style=\"list-style-type: {$style}\"><li>Foobar</li><li>Zend</li></ol>";
  251. $this->assertEquals($expected, $this->_markup->render($input));
  252. }
  253. }
  254. public function testHtmlTags()
  255. {
  256. $m = $this->_markup;
  257. $this->assertEquals('<strong>foo</strong>', $m->render('[b]foo[/b]'));
  258. $this->assertEquals('<span style="text-decoration: underline;">foo</span>',
  259. $m->render('[u]foo[/u]'));
  260. $this->assertEquals('<em>foo</em>', $m->render('[i]foo[/i]'));
  261. $this->assertEquals('<cite>foo</cite>', $m->render('[cite]foo[/cite]'));
  262. $this->assertEquals('<del>foo</del>', $m->render('[del]foo[/del]'));
  263. $this->assertEquals('<ins>foo</ins>', $m->render('[ins]foo[/ins]'));
  264. $this->assertEquals('<sub>foo</sub>', $m->render('[sub]foo[/sub]'));
  265. $this->assertEquals('<span>foo</span>', $m->render('[span]foo[/span]'));
  266. $this->assertEquals('<acronym>foo</acronym>', $m->render('[acronym]foo[/acronym]'));
  267. $this->assertEquals('<h1>F</h1>', $m->render('[h1]F[/h1]'));
  268. $this->assertEquals('<h2>R</h2>', $m->render('[h2]R[/h2]'));
  269. $this->assertEquals('<h3>E</h3>', $m->render('[h3]E[/h3]'));
  270. $this->assertEquals('<h4>E</h4>', $m->render('[h4]E[/h4]'));
  271. $this->assertEquals('<h5>A</h5>', $m->render('[h5]A[/h5]'));
  272. $this->assertEquals('<h6>Q</h6>', $m->render('[h6]Q[/h6]'));
  273. $this->assertEquals('<span style="color: red;">foo</span>', $m->render('[color=red]foo[/color]'));
  274. $this->assertEquals('<span style="color: #00FF00;">foo</span>', $m->render('[color=#00FF00]foo[/color]'));
  275. $expected = '<code><span style="color: #000000">' . "\n"
  276. . '<span style="color: #0000BB">&lt;?php<br /></span>'
  277. . "<span style=\"color: #007700\">exit;</span>\n</span>\n</code>";
  278. $this->assertEquals($expected, $m->render("[code]<?php\nexit;[/code]"));
  279. $this->assertEquals('<p>I</p>', $m->render('[p]I[/p]'));
  280. $this->assertEquals('N',
  281. $m->render('[ignore]N[/ignore]'));
  282. $this->assertEquals('<blockquote>M</blockquote>', $m->render('[quote]M[/quote]'));
  283. $this->assertEquals('<hr />foo<hr />bar[/hr]', $m->render('[hr]foo[hr]bar[/hr]'));
  284. }
  285. public function testWrongNesting()
  286. {
  287. $this->assertEquals('<strong>foo<em>bar</em></strong>',
  288. $this->_markup->render('[b]foo[i]bar[/b][/i]'));
  289. $this->assertEquals('<strong>foo<em>bar</em></strong><em>kokx</em>',
  290. $this->_markup->render('[b]foo[i]bar[/b]kokx[/i]'));
  291. }
  292. public function testHtmlAliases()
  293. {
  294. $m = $this->_markup;
  295. $this->assertEquals($m->render('[b]F[/b]'), $m->render('[bold]F[/bold]'));
  296. $this->assertEquals($m->render('[bold]R[/bold]'), $m->render('[strong]R[/strong]'));
  297. $this->assertEquals($m->render('[i]E[/i]'), $m->render('[i]E[/i]'));
  298. $this->assertEquals($m->render('[i]E[/i]'), $m->render('[italic]E[/italic]'));
  299. $this->assertEquals($m->render('[i]A[/i]'), $m->render('[emphasized]A[/emphasized]'));
  300. $this->assertEquals($m->render('[i]Q[/i]'), $m->render('[em]Q[/em]'));
  301. $this->assertEquals($m->render('[u]I[/u]'), $m->render('[underline]I[/underline]'));
  302. $this->assertEquals($m->render('[cite]N[/cite]'), $m->render('[citation]N[/citation]'));
  303. $this->assertEquals($m->render('[del]G[/del]'), $m->render('[deleted]G[/deleted]'));
  304. $this->assertEquals($m->render('[ins]M[/ins]'), $m->render('[insert]M[/insert]'));
  305. $this->assertEquals($m->render('[s]E[/s]'),$m->render('[strike]E[/strike]'));
  306. $this->assertEquals($m->render('[sub]-[/sub]'), $m->render('[subscript]-[/subscript]'));
  307. $this->assertEquals($m->render('[sup]D[/sup]'), $m->render('[superscript]D[/superscript]'));
  308. $this->assertEquals($m->render('[url]google.com[/url]'), $m->render('[a]google.com[/a]'));
  309. $this->assertEquals($m->render('[img]http://google.com/favicon.ico[/img]'),
  310. $m->render('[image]http://google.com/favicon.ico[/image]'));
  311. }
  312. public function testEmptyTagName()
  313. {
  314. $this->assertEquals('[]', $this->_markup->render('[]'));
  315. }
  316. public function testStyleAlignCombination()
  317. {
  318. $m = $this->_markup;
  319. $this->assertEquals('<h1 style="color: green;text-align: left;">Foobar</h1>',
  320. $m->render('[h1 style="color: green" align=left]Foobar[/h1]'));
  321. $this->assertEquals('<h1 style="color: green;text-align: center;">Foobar</h1>',
  322. $m->render('[h1 style="color: green;" align=center]Foobar[/h1]'));
  323. }
  324. public function testXssInAttributeValues()
  325. {
  326. $m = $this->_markup;
  327. $this->assertEquals('<strong class="&quot;&gt;xss">foobar</strong>',
  328. $m->render('[b class=\'">xss\']foobar[/b]'));
  329. }
  330. public function testWrongNestedLists()
  331. {
  332. $m = $this->_markup;
  333. // thanks to PadraicB for finding this
  334. $input = <<<BBCODE
  335. [list]
  336. [*] Subject 1
  337. [list]
  338. [*] First
  339. [*] Second
  340. [/list]
  341. [*] Subject 2
  342. [/list]
  343. BBCODE;
  344. $m->render($input);
  345. }
  346. public function testAttributeWithoutValue()
  347. {
  348. $m = $this->_markup;
  349. $this->assertEquals('<strong>foobar</strong>', $m->render('[b=]foobar[/b]'));
  350. }
  351. public function testRemoveTag()
  352. {
  353. $this->_markup->removeMarkup('b');
  354. $this->assertEquals('[b]bar[/b]', $this->_markup->render('[b]bar[/b]'));
  355. }
  356. public function testClearTags()
  357. {
  358. $this->_markup->clearMarkups();
  359. $this->assertEquals('[i]foo[/i]', $this->_markup->render('[i]foo[/i]'));
  360. }
  361. public function testAddFilters()
  362. {
  363. $m = $this->_markup;
  364. $m->addDefaultFilter(new Zend_Filter_StringToUpper());
  365. $this->assertEquals('<strong>HELLO</strong>', $m->render('[b]hello[/b]'));
  366. }
  367. public function testProvideFilterChainToTag()
  368. {
  369. $m = $this->_markup;
  370. $filter = new Zend_Filter_HtmlEntities();
  371. $this->_markup->addMarkup('suppp',
  372. Zend_Markup_Renderer_RendererAbstract::TYPE_REPLACE,
  373. array('start' => '<sup>', 'end' => '</sup>', 'group' => 'inline', 'filter' => $filter));
  374. $this->assertEquals("filter<br />\n<sup>filter\n&amp;\nfilter</sup>",
  375. $m->render("filter\n[suppp]filter\n&\nfilter[/suppp]"));
  376. }
  377. public function testSetFilterForExistingMarkup()
  378. {
  379. $m = $this->_markup;
  380. $filter = new Zend_Filter_StringToUpper();
  381. $m->setFilter($filter, 'strong');
  382. $this->assertEquals('<strong>FOO&BAR</strong>baz', $m->render('[b]foo&bar[/b]baz'));
  383. }
  384. public function testAddFilterForExistingMarkup()
  385. {
  386. $m = $this->_markup;
  387. $filter = new Zend_Filter_StringToUpper();
  388. $m->addFilter($filter, 'i', Zend_Filter::CHAIN_PREPEND);
  389. $this->assertEquals('<em>FOO&amp;BAR</em>baz', $m->render('[i]foo&bar[/i]baz'));
  390. }
  391. public function testValidUri()
  392. {
  393. $this->assertTrue(Zend_Markup_Renderer_Html::isValidUri("http://www.example.com"));
  394. $this->assertTrue(!Zend_Markup_Renderer_Html::isValidUri("www.example.com"));
  395. $this->assertTrue(!Zend_Markup_Renderer_Html::isValidUri("http:///test"));
  396. $this->assertTrue(Zend_Markup_Renderer_Html::isValidUri("https://www.example.com"));
  397. $this->assertTrue(Zend_Markup_Renderer_Html::isValidUri("magnet:?xt=urn:bitprint:XZBS763P4HBFYVEMU5OXQ44XK32OMLIN.HGX3CO3BVF5AG2G34MVO3OHQLRSUF4VJXQNLQ7A &xt=urn:ed2khash:aa52fb210465bddd679d6853b491ccce&"));
  398. $this->assertTrue(!Zend_Markup_Renderer_Html::isValidUri("javascript:alert(1)"));
  399. }
  400. public function testXssInImgAndUrl()
  401. {
  402. $this->assertEquals('<a href="http://google.com/&quot;&lt;script&gt;alert(1)&lt;/script&gt;">...</a>',
  403. $this->_markup->render('[url=\'http://google.com/"<script>alert(1)</script>\']...[/url]'));
  404. $this->assertEquals('<img src="http://google.com/&amp;quot;&amp;lt;script&amp;gt;alert(1)&amp;lt;/script&amp;gt;" alt="/script&amp;gt;" />',
  405. $this->_markup->render('[img]http://google.com/"<script>alert(1)</script>[/img]'));
  406. }
  407. public function testAddGroup()
  408. {
  409. $m = $this->_markup;
  410. $m->addGroup('table', array('block'));
  411. $m->addGroup('table-row', array('table'));
  412. $m->addGroup('table-cell', array('table-row'), array('inline', 'inline-empty'));
  413. $m->addMarkup(
  414. 'table',
  415. Zend_Markup_Renderer_RendererAbstract::TYPE_REPLACE,
  416. array(
  417. 'tag' => 'table',
  418. 'group' => 'table'
  419. )
  420. );
  421. $m->addMarkup(
  422. 'tr',
  423. Zend_Markup_Renderer_RendererAbstract::TYPE_REPLACE,
  424. array(
  425. 'tag' => 'tr',
  426. 'group' => 'table-row'
  427. )
  428. );
  429. $m->addMarkup(
  430. 'td',
  431. Zend_Markup_Renderer_RendererAbstract::TYPE_REPLACE,
  432. array(
  433. 'tag' => 'td',
  434. 'group' => 'table-cell'
  435. )
  436. );
  437. $this->assertEquals('<table><tr><td>test</td></tr></table>',
  438. $m->render('[table][tr][td]test[/td][/tr][/table]'));
  439. }
  440. /**
  441. * Test for ZF-9220
  442. */
  443. public function testUrlMatchCorrectly()
  444. {
  445. $m = $this->_markup;
  446. $this->assertEquals('<a href="http://framework.zend.com/">test</a><a href="http://framework.zend.com/">test</a>',
  447. $m->render('[url="http://framework.zend.com/"]test[/url][url="http://framework.zend.com/"]test[/url]'));
  448. }
  449. /**
  450. * Test for ZF-9463
  451. */
  452. public function testNoXssInH()
  453. {
  454. $m = $this->_markup;
  455. $this->assertEquals('<h1>&lt;script&gt;alert(&quot;hi&quot;);&lt;/script&gt;</h1>',
  456. $m->render('[h1]<script>alert("hi");</script>[/h1]'));
  457. }
  458. }
  459. // Call Zend_Markup_BbcodeAndHtmlTest::main()
  460. // if this source file is executed directly.
  461. if (PHPUnit_MAIN_METHOD == "Zend_Markup_BbcodeAndHtmlTest::main") {
  462. Zend_Markup_BbcodeAndHtmlTest::main();
  463. }