From 8bbd11bf210b33dfe9846b83be8d6bd108cef2b9 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Mon, 9 Jul 2007 02:19:15 +0000 Subject: + Cleaned up runtests.pl. Incorporated table tests in loop with main writer tests. + Renamed tables.tex to tables.latex, tables.db to tables.docbook, for consistency with the writer tests. git-svn-id: https://pandoc.googlecode.com/svn/trunk@661 788f1e2b-df1e-0410-8736-df70ead52e1b --- tests/runtests.pl | 49 ++------- tests/tables.db | 286 --------------------------------------------------- tests/tables.docbook | 286 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/tables.latex | 139 +++++++++++++++++++++++++ tests/tables.tex | 139 ------------------------- 5 files changed, 435 insertions(+), 464 deletions(-) delete mode 100644 tests/tables.db create mode 100644 tests/tables.docbook create mode 100644 tests/tables.latex delete mode 100644 tests/tables.tex diff --git a/tests/runtests.pl b/tests/runtests.pl index 8c0392259..282d14aeb 100644 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -38,24 +38,28 @@ sub test_results foreach my $format (@writeformats) { $options = ""; - if ($format =~ /smart\./) - { - $options = "-S "; - } my $extension = $format; - $extension =~ s/smart\.//g; - print "Testing $format writer..."; + `$script -r native -w $extension $options -s $source > tmp.$extension`; test_results("$format writer", "tmp.$extension", "writer.$format"); + + print " $format tables..."; + + `$script -r native -w $extension tables.native > tmp.$extension`; + + test_results("$format writer", "tmp.$extension", "tables.$format"); } print "Testing docbook writer..."; # remove HTML block tests, as this produces invalid docbook... `sed -e '/^, Header 1 \\[Str "HTML",Space,Str "Blocks"\\]/,/^, HorizontalRule/d' testsuite.native | $script -r native -w docbook -s > tmp.docbook`; test_results("docbook writer", "tmp.docbook", "writer.docbook"); +`$script -r native -w docbook tables.native > tmp.docbook`; +print " docbook tables..."; +test_results("docbook tables", "tmp.docbook", "tables.docbook"); print "Testing s5 writer (basic)..."; `$script -r native -w s5 -s s5.native > tmp.html`; @@ -73,45 +77,12 @@ print "Testing -H -B -A -c options..."; `$script -r native -s -w html -H insert -B insert -A insert -c main.css s5.native > tmp.html`; test_results("-B, -A, -H, -c options", "tmp.html", "s5.inserts.html"); -print "Testing tables:\n"; -print " html writer..."; -`$script -r native -w html tables.native > tmp.html`; -test_results("html table writer", "tmp.html", "tables.html"); - -print " latex writer..."; -`$script -r native -w latex tables.native > tmp.tex`; -test_results("latex table writer", "tmp.tex", "tables.tex"); - -print " docbook writer..."; -`$script -r native -w docbook tables.native > tmp.db`; -test_results("docbook table writer", "tmp.db", "tables.db"); - -print " rtf writer..."; -`$script -r native -w rtf tables.native > tmp.rtf`; -test_results("rtf table writer", "tmp.rtf", "tables.rtf"); - -print " markdown writer..."; -`$script -r native -w markdown tables.native > tmp.markdown`; -test_results("markdown table writer", "tmp.markdown", "tables.markdown"); - -print " rst writer..."; -`$script -r native -w rst tables.native > tmp.rst`; -test_results("rst table writer", "tmp.rst", "tables.rst"); - -print " man writer..."; -`$script -r native -w man tables.native > tmp.man`; -test_results("man table writer", "tmp.man", "tables.man"); - print "\nReader tests:\n"; print "Testing markdown reader..."; `$script -r markdown -w native -s -S testsuite.txt > tmp.native`; test_results("markdown reader", "tmp.native", "testsuite.native"); -print " tables..."; -`$script -r markdown -w native tables.txt > tmp.native`; -test_results("markdown table reader", "tmp.native", "tables.native"); - print "Testing rst reader..."; `$script -r rst -w native -s rst-reader.rst > tmp.native`; test_results("rst reader", "tmp.native", "rst-reader.native"); diff --git a/tests/tables.db b/tests/tables.db deleted file mode 100644 index 0bb094307..000000000 --- a/tests/tables.db +++ /dev/null @@ -1,286 +0,0 @@ - - Simple table with caption: - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Demonstration of simple table syntax. -
- Right - - Left - - Center - - Default -
- 12 - - 12 - - 12 - - 12 -
- 123 - - 123 - - 123 - - 123 -
- 1 - - 1 - - 1 - - 1 -
- - Simple table without caption: - - - - - Right - - - Left - - - Center - - - Default - - - - - 12 - - - 12 - - - 12 - - - 12 - - - - - 123 - - - 123 - - - 123 - - - 123 - - - - - 1 - - - 1 - - - 1 - - - 1 - - - - - Simple table indented two spaces: - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Demonstration of simple table syntax. -
- Right - - Left - - Center - - Default -
- 12 - - 12 - - 12 - - 12 -
- 123 - - 123 - - 123 - - 123 -
- 1 - - 1 - - 1 - - 1 -
- - Multiline table with caption: - - - - - - - - - - - - - - - - - - - - - -
- Here's the caption. It may span multiple lines. -
- Centered Header - - Left Aligned - - Right Aligned - - Default aligned -
- First - - row - - 12.0 - - Example of a row that spans multiple lines. -
- Second - - row - - 5.0 - - Here's another one. Note the blank line between rows. -
- - Multiline table without caption: - - - - - Centered Header - - - Left Aligned - - - Right Aligned - - - Default aligned - - - - - First - - - row - - - 12.0 - - - Example of a row that spans multiple lines. - - - - - Second - - - row - - - 5.0 - - - Here's another one. Note the blank line between rows. - - - diff --git a/tests/tables.docbook b/tests/tables.docbook new file mode 100644 index 000000000..0bb094307 --- /dev/null +++ b/tests/tables.docbook @@ -0,0 +1,286 @@ + + Simple table with caption: + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Demonstration of simple table syntax. +
+ Right + + Left + + Center + + Default +
+ 12 + + 12 + + 12 + + 12 +
+ 123 + + 123 + + 123 + + 123 +
+ 1 + + 1 + + 1 + + 1 +
+ + Simple table without caption: + + + + + Right + + + Left + + + Center + + + Default + + + + + 12 + + + 12 + + + 12 + + + 12 + + + + + 123 + + + 123 + + + 123 + + + 123 + + + + + 1 + + + 1 + + + 1 + + + 1 + + + + + Simple table indented two spaces: + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Demonstration of simple table syntax. +
+ Right + + Left + + Center + + Default +
+ 12 + + 12 + + 12 + + 12 +
+ 123 + + 123 + + 123 + + 123 +
+ 1 + + 1 + + 1 + + 1 +
+ + Multiline table with caption: + + + + + + + + + + + + + + + + + + + + + +
+ Here's the caption. It may span multiple lines. +
+ Centered Header + + Left Aligned + + Right Aligned + + Default aligned +
+ First + + row + + 12.0 + + Example of a row that spans multiple lines. +
+ Second + + row + + 5.0 + + Here's another one. Note the blank line between rows. +
+ + Multiline table without caption: + + + + + Centered Header + + + Left Aligned + + + Right Aligned + + + Default aligned + + + + + First + + + row + + + 12.0 + + + Example of a row that spans multiple lines. + + + + + Second + + + row + + + 5.0 + + + Here's another one. Note the blank line between rows. + + + diff --git a/tests/tables.latex b/tests/tables.latex new file mode 100644 index 000000000..4cbb27385 --- /dev/null +++ b/tests/tables.latex @@ -0,0 +1,139 @@ +Simple table with caption: + +\begin{table}[h] +\begin{center} +\begin{tabular}{>{\PBS\raggedleft\hspace{0pt}}p{0.15\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.09\textwidth}>{\PBS\centering\hspace{0pt}}p{0.16\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.13\textwidth}} +Right + & Left + & Center + & Default +\\ +\hline +12 + & 12 + & 12 + & 12 +\\ +123 + & 123 + & 123 + & 123 +\\ +1 + & 1 + & 1 + & 1 +\\ +\end{tabular} +\end{center} +\caption{Demonstration of simple table syntax.} +\end{table} + +Simple table without caption: + +\begin{center} +\begin{tabular}{>{\PBS\raggedleft\hspace{0pt}}p{0.15\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.09\textwidth}>{\PBS\centering\hspace{0pt}}p{0.16\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.13\textwidth}} +Right + & Left + & Center + & Default +\\ +\hline +12 + & 12 + & 12 + & 12 +\\ +123 + & 123 + & 123 + & 123 +\\ +1 + & 1 + & 1 + & 1 +\\ +\end{tabular} +\end{center} + +Simple table indented two spaces: + +\begin{table}[h] +\begin{center} +\begin{tabular}{>{\PBS\raggedleft\hspace{0pt}}p{0.15\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.09\textwidth}>{\PBS\centering\hspace{0pt}}p{0.16\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.13\textwidth}} +Right + & Left + & Center + & Default +\\ +\hline +12 + & 12 + & 12 + & 12 +\\ +123 + & 123 + & 123 + & 123 +\\ +1 + & 1 + & 1 + & 1 +\\ +\end{tabular} +\end{center} +\caption{Demonstration of simple table syntax.} +\end{table} + +Multiline table with caption: + +\begin{table}[h] +\begin{center} +\begin{tabular}{>{\PBS\centering\hspace{0pt}}p{0.15\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.14\textwidth}>{\PBS\raggedleft\hspace{0pt}}p{0.16\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.34\textwidth}} +Centered Header + & Left Aligned + & Right Aligned + & Default aligned +\\ +\hline +First + & row + & 12.0 + & Example of a row that spans multiple lines. +\\ +Second + & row + & 5.0 + & Here's another one. Note the blank line between rows. +\\ +\end{tabular} +\end{center} +\caption{Here's the caption. It may span multiple lines.} +\end{table} + +Multiline table without caption: + +\begin{center} +\begin{tabular}{>{\PBS\centering\hspace{0pt}}p{0.15\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.14\textwidth}>{\PBS\raggedleft\hspace{0pt}}p{0.16\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.34\textwidth}} +Centered Header + & Left Aligned + & Right Aligned + & Default aligned +\\ +\hline +First + & row + & 12.0 + & Example of a row that spans multiple lines. +\\ +Second + & row + & 5.0 + & Here's another one. Note the blank line between rows. +\\ +\end{tabular} +\end{center} + diff --git a/tests/tables.tex b/tests/tables.tex deleted file mode 100644 index 4cbb27385..000000000 --- a/tests/tables.tex +++ /dev/null @@ -1,139 +0,0 @@ -Simple table with caption: - -\begin{table}[h] -\begin{center} -\begin{tabular}{>{\PBS\raggedleft\hspace{0pt}}p{0.15\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.09\textwidth}>{\PBS\centering\hspace{0pt}}p{0.16\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.13\textwidth}} -Right - & Left - & Center - & Default -\\ -\hline -12 - & 12 - & 12 - & 12 -\\ -123 - & 123 - & 123 - & 123 -\\ -1 - & 1 - & 1 - & 1 -\\ -\end{tabular} -\end{center} -\caption{Demonstration of simple table syntax.} -\end{table} - -Simple table without caption: - -\begin{center} -\begin{tabular}{>{\PBS\raggedleft\hspace{0pt}}p{0.15\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.09\textwidth}>{\PBS\centering\hspace{0pt}}p{0.16\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.13\textwidth}} -Right - & Left - & Center - & Default -\\ -\hline -12 - & 12 - & 12 - & 12 -\\ -123 - & 123 - & 123 - & 123 -\\ -1 - & 1 - & 1 - & 1 -\\ -\end{tabular} -\end{center} - -Simple table indented two spaces: - -\begin{table}[h] -\begin{center} -\begin{tabular}{>{\PBS\raggedleft\hspace{0pt}}p{0.15\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.09\textwidth}>{\PBS\centering\hspace{0pt}}p{0.16\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.13\textwidth}} -Right - & Left - & Center - & Default -\\ -\hline -12 - & 12 - & 12 - & 12 -\\ -123 - & 123 - & 123 - & 123 -\\ -1 - & 1 - & 1 - & 1 -\\ -\end{tabular} -\end{center} -\caption{Demonstration of simple table syntax.} -\end{table} - -Multiline table with caption: - -\begin{table}[h] -\begin{center} -\begin{tabular}{>{\PBS\centering\hspace{0pt}}p{0.15\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.14\textwidth}>{\PBS\raggedleft\hspace{0pt}}p{0.16\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.34\textwidth}} -Centered Header - & Left Aligned - & Right Aligned - & Default aligned -\\ -\hline -First - & row - & 12.0 - & Example of a row that spans multiple lines. -\\ -Second - & row - & 5.0 - & Here's another one. Note the blank line between rows. -\\ -\end{tabular} -\end{center} -\caption{Here's the caption. It may span multiple lines.} -\end{table} - -Multiline table without caption: - -\begin{center} -\begin{tabular}{>{\PBS\centering\hspace{0pt}}p{0.15\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.14\textwidth}>{\PBS\raggedleft\hspace{0pt}}p{0.16\textwidth}>{\PBS\raggedright\hspace{0pt}}p{0.34\textwidth}} -Centered Header - & Left Aligned - & Right Aligned - & Default aligned -\\ -\hline -First - & row - & 12.0 - & Example of a row that spans multiple lines. -\\ -Second - & row - & 5.0 - & Here's another one. Note the blank line between rows. -\\ -\end{tabular} -\end{center} - -- cgit v1.2.3