summaryrefslogtreecommitdiff
path: root/_test/cases/inc/parser
diff options
context:
space:
mode:
authorhfuecks <hfuecks@gmail.com>2005-11-07 00:38:00 +0100
committerhfuecks <hfuecks@gmail.com>2005-11-07 00:38:00 +0100
commitfc1c55b1830fbbb13f99db0490df4f46e15dcd31 (patch)
treec95e7c3ca97b6afcbc7fbda6300808ff46b089d8 /_test/cases/inc/parser
parent4add97cbe7c3aae97c8c54fc6a3bd7fae1de29a2 (diff)
downloadrpg-fc1c55b1830fbbb13f99db0490df4f46e15dcd31.tar.gz
rpg-fc1c55b1830fbbb13f99db0490df4f46e15dcd31.tar.bz2
get_tests_running_1
darcs-hash:20051106233800-e96b6-90328f1b6cc5c8b25c6e02f113cf80475789d297.gz
Diffstat (limited to '_test/cases/inc/parser')
-rw-r--r--_test/cases/inc/parser/lexer.group.php2
-rw-r--r--_test/cases/inc/parser/lexer.test.php122
-rw-r--r--_test/cases/inc/parser/parser.group.php27
-rw-r--r--_test/cases/inc/parser/parser_links.test.php5
-rw-r--r--_test/cases/inc/parser/parser_unformatted.test.php1
5 files changed, 80 insertions, 77 deletions
diff --git a/_test/cases/inc/parser/lexer.group.php b/_test/cases/inc/parser/lexer.group.php
index 99ec993be..6e9ef0742 100644
--- a/_test/cases/inc/parser/lexer.group.php
+++ b/_test/cases/inc/parser/lexer.group.php
@@ -13,7 +13,7 @@ class LexerGroupTest extends GroupTest {
function LexerGroupTest() {
$this->GroupTest('LexerGroupTest');
- $this->addTestFile('lexer.test.php');
+ $this->addTestFile(dirname(__FILE__).'/lexer.test.php');
}
}
diff --git a/_test/cases/inc/parser/lexer.test.php b/_test/cases/inc/parser/lexer.test.php
index 818009f92..75fa32ee0 100644
--- a/_test/cases/inc/parser/lexer.test.php
+++ b/_test/cases/inc/parser/lexer.test.php
@@ -355,7 +355,7 @@ class TestParserByteIndex {
function ignore() {}
- function catch() {}
+ function caught() {}
}
Mock::generate('TestParserByteIndex');
@@ -371,41 +371,41 @@ class TestOfLexerByteIndices extends UnitTestCase {
$handler = &new MockTestParserByteIndex($this);
$handler->setReturnValue("ignore", true);
- $handler->setReturnValue("catch", true);
+ $handler->setReturnValue("caught", true);
$handler->expectArgumentsAt(
0,
- "catch",
+ "caught",
array("<file>", DOKU_LEXER_ENTER, strpos($doc,'<file>'))
);
$handler->expectArgumentsAt(
1,
- "catch",
+ "caught",
array("b", DOKU_LEXER_SPECIAL, strpos($doc,'b'))
);
$handler->expectArgumentsAt(
2,
- "catch",
+ "caught",
array("c", DOKU_LEXER_MATCHED, strpos($doc,'c'))
);
$handler->expectArgumentsAt(
3,
- "catch",
+ "caught",
array("d", DOKU_LEXER_UNMATCHED, strpos($doc,'d'))
);
$handler->expectArgumentsAt(
4,
- "catch",
+ "caught",
array("</file>", DOKU_LEXER_EXIT, strpos($doc,'</file>'))
);
- $handler->expectCallCount("catch", 5);
+ $handler->expectCallCount("caught", 5);
$lexer = &new Doku_Lexer($handler, "ignore");
- $lexer->addEntryPattern("<file>", "ignore", "catch");
- $lexer->addExitPattern("</file>", "catch");
- $lexer->addSpecialPattern('b','catch','special');
- $lexer->mapHandler('special','catch');
- $lexer->addPattern('c','catch');
+ $lexer->addEntryPattern("<file>", "ignore", "caught");
+ $lexer->addExitPattern("</file>", "caught");
+ $lexer->addSpecialPattern('b','caught','special');
+ $lexer->mapHandler('special','caught');
+ $lexer->addPattern('c','caught');
$this->assertTrue($lexer->parse($doc));
$handler->tally();
@@ -416,41 +416,41 @@ class TestOfLexerByteIndices extends UnitTestCase {
$handler = &new MockTestParserByteIndex($this);
$handler->setReturnValue("ignore", true);
- $handler->setReturnValue("catch", true);
+ $handler->setReturnValue("caught", true);
$handler->expectArgumentsAt(
0,
- "catch",
+ "caught",
array("<file>", DOKU_LEXER_ENTER, strpos($doc,'<file>'))
);
$handler->expectArgumentsAt(
1,
- "catch",
+ "caught",
array("b", DOKU_LEXER_SPECIAL, strpos($doc,'b'))
);
$handler->expectArgumentsAt(
2,
- "catch",
+ "caught",
array("c", DOKU_LEXER_MATCHED, strpos($doc,'c'))
);
$handler->expectArgumentsAt(
3,
- "catch",
+ "caught",
array("d", DOKU_LEXER_UNMATCHED, strpos($doc,'d'))
);
$handler->expectArgumentsAt(
4,
- "catch",
+ "caught",
array("</file>", DOKU_LEXER_EXIT, strpos($doc,'</file>'))
);
- $handler->expectCallCount("catch", 5);
+ $handler->expectCallCount("caught", 5);
$lexer = &new Doku_Lexer($handler, "ignore");
- $lexer->addEntryPattern('<file>(?=.*\x3C/file\x3E)', "ignore", "catch");
- $lexer->addExitPattern("</file>", "catch");
- $lexer->addSpecialPattern('b','catch','special');
- $lexer->mapHandler('special','catch');
- $lexer->addPattern('c','catch');
+ $lexer->addEntryPattern('<file>(?=.*\x3C/file\x3E)', "ignore", "caught");
+ $lexer->addExitPattern("</file>", "caught");
+ $lexer->addSpecialPattern('b','caught','special');
+ $lexer->mapHandler('special','caught');
+ $lexer->addPattern('c','caught');
$this->assertTrue($lexer->parse($doc));
$handler->tally();
@@ -461,41 +461,41 @@ class TestOfLexerByteIndices extends UnitTestCase {
$handler = &new MockTestParserByteIndex($this);
$handler->setReturnValue("ignore", true);
- $handler->setReturnValue("catch", true);
+ $handler->setReturnValue("caught", true);
$handler->expectArgumentsAt(
0,
- "catch",
+ "caught",
array("<file>", DOKU_LEXER_ENTER, strpos($doc,'<file>'))
);
$handler->expectArgumentsAt(
1,
- "catch",
+ "caught",
array("b", DOKU_LEXER_SPECIAL, strpos($doc,'b'))
);
$handler->expectArgumentsAt(
2,
- "catch",
+ "caught",
array("c", DOKU_LEXER_MATCHED, strpos($doc,'c'))
);
$handler->expectArgumentsAt(
3,
- "catch",
+ "caught",
array("d", DOKU_LEXER_UNMATCHED, strpos($doc,'d'))
);
$handler->expectArgumentsAt(
4,
- "catch",
+ "caught",
array("</file>", DOKU_LEXER_EXIT, strpos($doc,'</file>'))
);
- $handler->expectCallCount("catch", 5);
+ $handler->expectCallCount("caught", 5);
$lexer = &new Doku_Lexer($handler, "ignore");
- $lexer->addEntryPattern('<file>(?!foo)', "ignore", "catch");
- $lexer->addExitPattern("</file>", "catch");
- $lexer->addSpecialPattern('b','catch','special');
- $lexer->mapHandler('special','catch');
- $lexer->addPattern('c','catch');
+ $lexer->addEntryPattern('<file>(?!foo)', "ignore", "caught");
+ $lexer->addExitPattern("</file>", "caught");
+ $lexer->addSpecialPattern('b','caught','special');
+ $lexer->mapHandler('special','caught');
+ $lexer->addPattern('c','caught');
$this->assertTrue($lexer->parse($doc));
$handler->tally();
@@ -506,41 +506,41 @@ class TestOfLexerByteIndices extends UnitTestCase {
$handler = &new MockTestParserByteIndex($this);
$handler->setReturnValue("ignore", true);
- $handler->setReturnValue("catch", true);
+ $handler->setReturnValue("caught", true);
$handler->expectArgumentsAt(
0,
- "catch",
+ "caught",
array("<file>", DOKU_LEXER_ENTER, strpos($doc,'<file>'))
);
$handler->expectArgumentsAt(
1,
- "catch",
+ "caught",
array("b", DOKU_LEXER_SPECIAL, strpos($doc,'b'))
);
$handler->expectArgumentsAt(
2,
- "catch",
+ "caught",
array("c", DOKU_LEXER_MATCHED, strpos($doc,'c'))
);
$handler->expectArgumentsAt(
3,
- "catch",
+ "caught",
array("d", DOKU_LEXER_UNMATCHED, strpos($doc,'d'))
);
$handler->expectArgumentsAt(
4,
- "catch",
+ "caught",
array("</file>", DOKU_LEXER_EXIT, strpos($doc,'</file>'))
);
- $handler->expectCallCount("catch", 5);
+ $handler->expectCallCount("caught", 5);
$lexer = &new Doku_Lexer($handler, "ignore");
- $lexer->addEntryPattern('<file>', "ignore", "catch");
- $lexer->addExitPattern("(?<=d)</file>", "catch");
- $lexer->addSpecialPattern('b','catch','special');
- $lexer->mapHandler('special','catch');
- $lexer->addPattern('c','catch');
+ $lexer->addEntryPattern('<file>', "ignore", "caught");
+ $lexer->addExitPattern("(?<=d)</file>", "caught");
+ $lexer->addSpecialPattern('b','caught','special');
+ $lexer->mapHandler('special','caught');
+ $lexer->addPattern('c','caught');
$this->assertTrue($lexer->parse($doc));
$handler->tally();
@@ -551,41 +551,41 @@ class TestOfLexerByteIndices extends UnitTestCase {
$handler = &new MockTestParserByteIndex($this);
$handler->setReturnValue("ignore", true);
- $handler->setReturnValue("catch", true);
+ $handler->setReturnValue("caught", true);
$handler->expectArgumentsAt(
0,
- "catch",
+ "caught",
array("<file>", DOKU_LEXER_ENTER, strpos($doc,'<file>'))
);
$handler->expectArgumentsAt(
1,
- "catch",
+ "caught",
array("b", DOKU_LEXER_SPECIAL, strpos($doc,'b'))
);
$handler->expectArgumentsAt(
2,
- "catch",
+ "caught",
array("c", DOKU_LEXER_MATCHED, strpos($doc,'c'))
);
$handler->expectArgumentsAt(
3,
- "catch",
+ "caught",
array("d", DOKU_LEXER_UNMATCHED, strpos($doc,'d'))
);
$handler->expectArgumentsAt(
4,
- "catch",
+ "caught",
array("</file>", DOKU_LEXER_EXIT, strpos($doc,'</file>'))
);
- $handler->expectCallCount("catch", 5);
+ $handler->expectCallCount("caught", 5);
$lexer = &new Doku_Lexer($handler, "ignore");
- $lexer->addEntryPattern('<file>', "ignore", "catch");
- $lexer->addExitPattern("(?<!c)</file>", "catch");
- $lexer->addSpecialPattern('b','catch','special');
- $lexer->mapHandler('special','catch');
- $lexer->addPattern('c','catch');
+ $lexer->addEntryPattern('<file>', "ignore", "caught");
+ $lexer->addExitPattern("(?<!c)</file>", "caught");
+ $lexer->addSpecialPattern('b','caught','special');
+ $lexer->mapHandler('special','caught');
+ $lexer->addPattern('c','caught');
$this->assertTrue($lexer->parse($doc));
$handler->tally();
diff --git a/_test/cases/inc/parser/parser.group.php b/_test/cases/inc/parser/parser.group.php
index bfd086999..a295f6882 100644
--- a/_test/cases/inc/parser/parser.group.php
+++ b/_test/cases/inc/parser/parser.group.php
@@ -12,20 +12,21 @@
class ParserGroupTest extends GroupTest {
function ParserGroupTest() {
+ $dir = dirname(__FILE__).'/';
$this->GroupTest('ParserGroupTest');
- $this->addTestFile('parser_eol.test.php');
- $this->addTestFile('parser_footnote.test.php');
- $this->addTestFile('parser_formatting.test.php');
- $this->addTestFile('parser_headers.test.php');
- $this->addTestFile('parser_i18n.test.php');
- $this->addTestFile('parser_links.test.php');
- $this->addTestFile('parser_lists.test.php');
- $this->addTestFile('parser_preformatted.test.php');
- $this->addTestFile('parser_quote.test.php');
- $this->addTestFile('parser_replacements.test.php');
- $this->addTestFile('parser_table.test.php');
- $this->addTestFile('parser_tocsections.test.php');
- $this->addTestFile('parser_unformatted.test.php');
+ $this->addTestFile($dir . 'parser_eol.test.php');
+ $this->addTestFile($dir . 'parser_footnote.test.php');
+ $this->addTestFile($dir .'parser_formatting.test.php');
+ $this->addTestFile($dir .'parser_headers.test.php');
+ $this->addTestFile($dir .'parser_i18n.test.php');
+ $this->addTestFile($dir .'parser_links.test.php');
+ $this->addTestFile($dir .'parser_lists.test.php');
+ $this->addTestFile($dir .'parser_preformatted.test.php');
+ $this->addTestFile($dir .'parser_quote.test.php');
+ $this->addTestFile($dir .'parser_replacements.test.php');
+ $this->addTestFile($dir .'parser_table.test.php');
+ $this->addTestFile($dir .'parser_tocsections.test.php');
+ $this->addTestFile($dir .'parser_unformatted.test.php');
}
}
diff --git a/_test/cases/inc/parser/parser_links.test.php b/_test/cases/inc/parser/parser_links.test.php
index 1bcdcd461..ff0389a8c 100644
--- a/_test/cases/inc/parser/parser_links.test.php
+++ b/_test/cases/inc/parser/parser_links.test.php
@@ -80,8 +80,9 @@ class TestOfDoku_Parser_Links extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripByteIndex',$this->H->calls),$calls);
}
-
function testEmail() {
+ $this->fail('The emaillink mode seems to cause php 5.0.5 to segfault');
+ return;
$this->P->addMode('email',new Doku_Parser_Mode_Emaillink());
$this->P->parse("Foo <bugs@php.net> Bar");
$calls = array (
@@ -95,7 +96,7 @@ class TestOfDoku_Parser_Links extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripByteIndex',$this->H->calls),$calls);
}
-
+
function testInternalLinkOneChar() {
$this->P->addMode('internallink',new Doku_Parser_Mode_InternalLink());
$this->P->parse("Foo [[l]] Bar");
diff --git a/_test/cases/inc/parser/parser_unformatted.test.php b/_test/cases/inc/parser/parser_unformatted.test.php
index 5a7d956a9..28f6e50cb 100644
--- a/_test/cases/inc/parser/parser_unformatted.test.php
+++ b/_test/cases/inc/parser/parser_unformatted.test.php
@@ -19,6 +19,7 @@ class TestOfDoku_Parser_Unformatted extends TestOfDoku_Parser {
array('p_close',array()),
array('document_end',array()),
);
+
$this->assertEqual(array_map('stripByteIndex',$this->H->calls),$calls);
}