[Zope-Checkins] CVS: Zope/lib/python/StructuredText/tests - testStructuredText.py:1.11

Andreas Jung andreas@zope.com
Fri, 19 Oct 2001 09:21:10 -0400


Update of /cvs-repository/Zope/lib/python/StructuredText/tests
In directory cvs.zope.org:/tmp/cvs-serv32122/tests

Modified Files:
	testStructuredText.py 
Log Message:
- _..._ was still broken. Even more __....__ was broken. Underlines are evil. 
- added script to recreate regression reference files
- added another test



=== Zope/lib/python/StructuredText/tests/testStructuredText.py 1.10 => 1.11 ===
         res = HTML(stxtxt,level=1,header=0)
         if res.find(expected)==-1:
-            print res
+            print "Text:     ",stxtxt
+            print "Converted:",res
+            print "Expected: ",expected
             raise AssertionError,"basic test failed for '%s'" % stxtxt
             
+
     def testUnderline(self):
         """underline"""
-        self._test("xx _this is html_ xx","xx <u>this is html</u> xx")
+        self._test("xx _this is html_ xx",
+                   "xx <u>this is html</u> xx")
         
     def testEmphasis(self):
         """ emphasis """
-        self._test("xx *this is html* xx","xx <em>this is html</em> xx")
+        self._test("xx *this is html* xx",
+                   "xx <em>this is html</em> xx")
 
     def testStrong(self):
         """ strong """
@@ -227,11 +232,24 @@
                    '<a href="index_html">index_html</a>')
 
     
-    def testUnderscoresInLiteral(self):
+    def testUnderscoresInLiteral1(self):
+        """ underscores in literals shouldn't do unterlining """
+
+        self._test("def __init__(self)",
+                   "def __init__(self)")
+
+    def testUnderscoresInLiteral2(self):
         """ underscores in literals shouldn't do unterlining """
 
         self._test("this is '__a_literal__' eh",
                    "<code>__a_literal__</code>")
+
+
+    def testUnderlinesWithoutWithspaces(self):
+        """ underscores in literals shouldn't do unterlining """
+
+        self._test("Zopes structured_text is sometimes a night_mare",
+                   "Zopes structured_text is sometimes a night_mare")
 
 def test_suite():
     suite = unittest.TestSuite()