[Checkins] SVN: zope.index/trunk/src/zope/index/text/ Add test for adjoining markup.
Tres Seaver
tseaver at palladion.com
Wed Jun 10 19:48:01 EDT 2009
Log message for revision 100821:
Add test for adjoining markup.
Changed:
U zope.index/trunk/src/zope/index/text/htmlsplitter.py
U zope.index/trunk/src/zope/index/text/tests/test_htmlsplitter.py
-=-
Modified: zope.index/trunk/src/zope/index/text/htmlsplitter.py
===================================================================
--- zope.index/trunk/src/zope/index/text/htmlsplitter.py 2009-06-10 23:46:20 UTC (rev 100820)
+++ zope.index/trunk/src/zope/index/text/htmlsplitter.py 2009-06-10 23:48:01 UTC (rev 100821)
@@ -43,5 +43,5 @@
return result
def _split(self, text, pattern):
- text = MARKUP.sub('', text.lower())
+ text = MARKUP.sub(' ', text.lower())
return pattern.findall(text)
Modified: zope.index/trunk/src/zope/index/text/tests/test_htmlsplitter.py
===================================================================
--- zope.index/trunk/src/zope/index/text/tests/test_htmlsplitter.py 2009-06-10 23:46:20 UTC (rev 100820)
+++ zope.index/trunk/src/zope/index/text/tests/test_htmlsplitter.py 2009-06-10 23:48:01 UTC (rev 100821)
@@ -70,6 +70,11 @@
self.assertEqual(splitter.process(['<h1>abc</h1> <p>def</p>']),
['abc', 'def'])
+ def test_process_w_markup_no_spaces(self):
+ splitter = self._makeOne()
+ self.assertEqual(splitter.process(['<h1>abc</h1> <p>def</p>']),
+ ['abc', 'def'])
+
def test_process_no_markup_w_glob(self):
splitter = self._makeOne()
self.assertEqual(splitter.process(['abc?def hij*klm nop* qrs?']),
More information about the Checkins
mailing list