diff options
-rw-r--r-- | tests/runtests.pl | 4 | ||||
-rw-r--r-- | tests/tables.rtf | 280 |
2 files changed, 284 insertions, 0 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl index 44b56f844..999e0b3a6 100644 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -86,6 +86,10 @@ 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 "\nReader tests:\n"; print "Testing markdown reader..."; diff --git a/tests/tables.rtf b/tests/tables.rtf new file mode 100644 index 000000000..06f482090 --- /dev/null +++ b/tests/tables.rtf @@ -0,0 +1,280 @@ +{\pard \ql \f0 \sa180 \li0 \fi0 Simple table with caption:\par} +{ +\trowd \trgaph120 +\clbrdrb\brdrs\cellx1296\clbrdrb\brdrs\cellx2052\clbrdrb\brdrs\cellx3456\clbrdrb\brdrs\cellx4536 +\trkeep\intbl +{ +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 Right\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Left\par} +\cell} +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Center\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Default\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2052\cellx3456\cellx4536 +\trkeep\intbl +{ +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +\cell} +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 12\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2052\cellx3456\cellx4536 +\trkeep\intbl +{ +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 123\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +\cell} +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 123\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2052\cellx3456\cellx4536 +\trkeep\intbl +{ +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 1\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +\cell} +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 1\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +\cell} +} +\intbl\row} +{\pard \ql \f0 \sa180 \li0 \fi0 Demonstration of simple table syntax.\par} +{\pard \ql \f0 \sa180 \li0 \fi0 Simple table without caption:\par} +{ +\trowd \trgaph120 +\clbrdrb\brdrs\cellx1296\clbrdrb\brdrs\cellx2052\clbrdrb\brdrs\cellx3456\clbrdrb\brdrs\cellx4536 +\trkeep\intbl +{ +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 Right\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Left\par} +\cell} +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Center\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Default\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2052\cellx3456\cellx4536 +\trkeep\intbl +{ +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +\cell} +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 12\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2052\cellx3456\cellx4536 +\trkeep\intbl +{ +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 123\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +\cell} +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 123\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2052\cellx3456\cellx4536 +\trkeep\intbl +{ +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 1\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +\cell} +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 1\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +\cell} +} +\intbl\row} +{\pard \ql \f0 \sa180 \li0 \fi0 \par} +{\pard \ql \f0 \sa180 \li0 \fi0 Simple table indented two spaces:\par} +{ +\trowd \trgaph120 +\clbrdrb\brdrs\cellx1296\clbrdrb\brdrs\cellx2052\clbrdrb\brdrs\cellx3456\clbrdrb\brdrs\cellx4536 +\trkeep\intbl +{ +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 Right\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Left\par} +\cell} +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Center\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Default\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2052\cellx3456\cellx4536 +\trkeep\intbl +{ +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +\cell} +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 12\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 12\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2052\cellx3456\cellx4536 +\trkeep\intbl +{ +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 123\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +\cell} +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 123\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 123\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2052\cellx3456\cellx4536 +\trkeep\intbl +{ +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 1\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +\cell} +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 1\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 1\par} +\cell} +} +\intbl\row} +{\pard \ql \f0 \sa180 \li0 \fi0 Demonstration of simple table syntax.\par} +{\pard \ql \f0 \sa180 \li0 \fi0 Multiline table with caption:\par} +{ +\trowd \trgaph120 +\clbrdrb\brdrs\cellx1296\clbrdrb\brdrs\cellx2484\clbrdrb\brdrs\cellx3888\clbrdrb\brdrs\cellx6804 +\trkeep\intbl +{ +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Centered Header\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Left Aligned\par} +\cell} +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 Right Aligned\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Default aligned\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2484\cellx3888\cellx6804 +\trkeep\intbl +{ +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 First\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 row\par} +\cell} +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12.0\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Example of a row that spans multiple lines.\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2484\cellx3888\cellx6804 +\trkeep\intbl +{ +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Second\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 row\par} +\cell} +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 5.0\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Here's another one. Note the blank line between rows.\par} +\cell} +} +\intbl\row} +{\pard \ql \f0 \sa180 \li0 \fi0 Here's the caption. It may span multiple lines.\par} +{\pard \ql \f0 \sa180 \li0 \fi0 Multiline table without caption:\par} +{ +\trowd \trgaph120 +\clbrdrb\brdrs\cellx1296\clbrdrb\brdrs\cellx2484\clbrdrb\brdrs\cellx3888\clbrdrb\brdrs\cellx6804 +\trkeep\intbl +{ +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Centered Header\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Left Aligned\par} +\cell} +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 Right Aligned\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Default aligned\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2484\cellx3888\cellx6804 +\trkeep\intbl +{ +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 First\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 row\par} +\cell} +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 12.0\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Example of a row that spans multiple lines.\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx1296\cellx2484\cellx3888\cellx6804 +\trkeep\intbl +{ +{\intbl {\pard \qc \f0 \sa0 \li0 \fi0 Second\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 row\par} +\cell} +{\intbl {\pard \qr \f0 \sa0 \li0 \fi0 5.0\par} +\cell} +{\intbl {\pard \ql \f0 \sa0 \li0 \fi0 Here's another one. Note the blank line between rows.\par} +\cell} +} +\intbl\row} +{\pard \ql \f0 \sa180 \li0 \fi0 \par} |