From 2895686a53a433ee6d243315ff6186de326f005f Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 19 Apr 2009 15:44:50 +0200 Subject: add unit tests for correct pattern selection when patterns contain non-captured elements (e.g. boundaries, lookaheads & lookbehinds) darcs-hash:20090419134450-f07c6-4ff7d226fcba002c840828336e73fb89cf48e3db.gz --- _test/cases/inc/parser/parser_replacements.test.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to '_test/cases/inc/parser/parser_replacements.test.php') diff --git a/_test/cases/inc/parser/parser_replacements.test.php b/_test/cases/inc/parser/parser_replacements.test.php index 73d3bf59e..11ebbd80a 100644 --- a/_test/cases/inc/parser/parser_replacements.test.php +++ b/_test/cases/inc/parser/parser_replacements.test.php @@ -40,6 +40,23 @@ class TestOfDoku_Parser_Replacements extends TestOfDoku_Parser { $this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls); } + function testPickAcronymCorrectly() { + $this->P->addMode('acronym',new Doku_Parser_Mode_Acronym(array('FOO'))); + $this->P->parse('ALL FOOLS ARE FOO'); + + $calls = array ( + array('document_start',array()), + array('p_open',array()), + array('cdata',array("\n".'ALL FOOLS ARE ')), + array('acronym',array('FOO')), + array('cdata',array("\n")), + array('p_close',array()), + array('document_end',array()), + ); + + $this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls); + } + function testMultipleAcronyms() { $this->P->addMode('acronym',new Doku_Parser_Mode_Acronym(array('FOO','BAR'))); $this->P->parse('abc FOO def BAR xyz'); -- cgit v1.2.3