From: Felix W. <fel...@us...> - 2004-12-24 22:22:11
|
Update of /cvsroot/docutils/docutils/test/test_parsers/test_rst/test_directives In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32414 Modified Files: test_include.py test_raw.py Log Message: fixed bug in tests (paths were getting messed up); added another test Index: test_include.py =================================================================== RCS file: /cvsroot/docutils/docutils/test/test_parsers/test_rst/test_directives/test_include.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- test_include.py 24 Dec 2004 21:53:30 -0000 1.14 +++ test_include.py 24 Dec 2004 22:22:00 -0000 1.15 @@ -27,6 +27,8 @@ include8 = os.path.join(mydir, 'include8.txt') include10 = os.path.join(mydir, 'include10.txt') include10rel = DocutilsTestSupport.utils.relative_path(None, include10) +utf_16_file = os.path.join(mydir, 'utf-16.csv') +utf_16_file_rel = DocutilsTestSupport.utils.relative_path(None, utf_16_file) totest = {} @@ -279,9 +281,9 @@ ["""\ Encoding: -.. include:: utf-16.csv +.. include:: %s :encoding: utf-16 -""", +""" % utf_16_file_rel, u"""\ <document source="test data"> <paragraph> @@ -293,6 +295,19 @@ crunchy, now would it?" "Gannet Ripple", 1.99, "\xbfOn a \\u03c3\\u03c4\\u03b9\\u03ba?" """], +["""\ +UTF-16 is no valid ASCII. BUG? + +.. include:: %s + :encoding: ascii +""" % utf_16_file_rel, +u"""\ +<document source="test data"> + <paragraph> + UTF-16 is no valid ASCII. BUG? + <paragraph> + \xfe\xff"Treat","Quantity","Description""Albatr\xb0\xdf",2.99,"\xa1Ona\x03\xc3\x03\xc4\x03\xb9\x03\xba!""CrunchyFrog",1.49,"Ifwetooktheb\xf6nesout,itwouldn \x19tbecrunchy,nowwouldit?""GannetRipple",1.99,"\xbfOna\x03\xc3\x03\xc4\x03\xb9\x03\xba?" +"""], # @@@ BUG with errors reported with incorrect "source" & "line": # ["""\ # Testing bad charent includes: Index: test_raw.py =================================================================== RCS file: /cvsroot/docutils/docutils/test/test_parsers/test_rst/test_directives/test_raw.py,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- test_raw.py 24 Dec 2004 21:53:30 -0000 1.4 +++ test_raw.py 24 Dec 2004 22:22:00 -0000 1.5 @@ -21,6 +21,8 @@ mydir = os.path.dirname(suite.func_code.co_filename) raw1 = os.path.join(mydir, 'raw1.txt') +utf_16_file = os.path.join(mydir, 'utf-16.csv') +utf_16_file_rel = DocutilsTestSupport.utils.relative_path(None, utf_16_file) totest = {} @@ -88,36 +90,36 @@ """], ["""\ .. raw:: html - :file: utf-16.csv + :file: %s :encoding: utf-16 -""", +""" % utf_16_file_rel, """\ <document source="test data"> - <raw format="html" source="utf-16.csv" xml:space="preserve"> + <raw format="html" source="%s" xml:space="preserve"> "Treat", "Quantity", "Description" "Albatr\xb0\xdf", 2.99, "\xa1On a \\u03c3\\u03c4\\u03b9\\u03ba!" "Crunchy Frog", 1.49, "If we took the b\xf6nes out, it wouldn\\u2019t be crunchy, now would it?" "Gannet Ripple", 1.99, "\xbfOn a \\u03c3\\u03c4\\u03b9\\u03ba?" -"""], +""" % utf_16_file_rel], ["""\ UTF-16 is no valid ASCII, but the parser doesn't complain. BUG? .. raw:: html - :file: utf-16.csv + :file: %s :encoding: ascii -""", +""" % utf_16_file_rel, """\ <document source="test data"> <paragraph> UTF-16 is no valid ASCII, but the parser doesn't complain. BUG? - <raw format="html" source="utf-16.csv" xml:space="preserve"> + <raw format="html" source="%s" xml:space="preserve"> \xfe\xff\x00"\x00T\x00r\x00e\x00a\x00t\x00"\x00,\x00 \x00"\x00Q\x00u\x00a\x00n\x00t\x00i\x00t\x00y\x00"\x00,\x00 \x00"\x00D\x00e\x00s\x00c\x00r\x00i\x00p\x00t\x00i\x00o\x00n\x00"\x00 \x00"\x00A\x00l\x00b\x00a\x00t\x00r\x00\xb0\x00\xdf\x00"\x00,\x00 \x002\x00.\x009\x009\x00,\x00 \x00"\x00\xa1\x00O\x00n\x00 \x00a\x00 \x03\xc3\x03\xc4\x03\xb9\x03\xba\x00!\x00"\x00 \x00"\x00C\x00r\x00u\x00n\x00c\x00h\x00y\x00 \x00F\x00r\x00o\x00g\x00"\x00,\x00 \x001\x00.\x004\x009\x00,\x00 \x00"\x00I\x00f\x00 \x00w\x00e\x00 \x00t\x00o\x00o\x00k\x00 \x00t\x00h\x00e\x00 \x00b\x00\xf6\x00n\x00e\x00s\x00 \x00o\x00u\x00t\x00,\x00 \x00i\x00t\x00 \x00w\x00o\x00u\x00l\x00d\x00n \x19\x00t\x00 \x00b\x00e\x00 \x00c\x00r\x00u\x00n\x00c\x00h\x00y\x00,\x00 \x00n\x00o\x00w\x00 \x00w\x00o\x00u\x00l\x00d\x00 \x00i\x00t\x00?\x00"\x00 \x00"\x00G\x00a\x00n\x00n\x00e\x00t\x00 \x00R\x00i\x00p\x00p\x00l\x00e\x00"\x00,\x00 \x001\x00.\x009\x009\x00,\x00 \x00"\x00\xbf\x00O\x00n\x00 \x00a\x00 \x03\xc3\x03\xc4\x03\xb9\x03\xba\x00?\x00"\x00 -"""], +""" % utf_16_file_rel], ["""\ .. raw:: html :encoding: utf-8 |