summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Writers/ConTeXt.hs64
-rw-r--r--test/tables.context56
-rw-r--r--test/writer.context5
-rw-r--r--test/writers-lang-and-dir.context5
4 files changed, 84 insertions, 46 deletions
diff --git a/test/Tests/Writers/ConTeXt.hs b/test/Tests/Writers/ConTeXt.hs
index aced9ab7d..272c58df3 100644
--- a/test/Tests/Writers/ConTeXt.hs
+++ b/test/Tests/Writers/ConTeXt.hs
@@ -135,34 +135,42 @@ tests =
[TableBody nullAttr 0 [] $ map toRow rows]
(TableFoot nullAttr [])
=?> unlines [ "\\startplacetable[title={Table 1}]"
- , "\\startTABLE"
- , "\\startTABLEhead"
- , "\\NC[align=left] Right"
- , "\\NC[align=right] Left"
- , "\\NC[align=middle] Center"
- , "\\NC Default"
- , "\\NC\\NR"
- , "\\stopTABLEhead"
- , "\\startTABLEbody"
- , "\\NC[align=left] 1.1"
- , "\\NC[align=right] 1.2"
- , "\\NC[align=middle] 1.3"
- , "\\NC 1.4"
- , "\\NC\\NR"
- , "\\NC[align=left] 2.1"
- , "\\NC[align=right] 2.2"
- , "\\NC[align=middle] 2.3"
- , "\\NC 2.4"
- , "\\NC\\NR"
- , "\\stopTABLEbody"
- , "\\startTABLEfoot"
- , "\\NC[align=left] 3.1"
- , "\\NC[align=right] 3.2"
- , "\\NC[align=middle] 3.3"
- , "\\NC 3.4"
- , "\\NC\\NR"
- , "\\stopTABLEfoot"
- , "\\stopTABLE"
+ , "\\setupTABLE[column][1][align=left]"
+ , "\\setupTABLE[column][2][align=right]"
+ , "\\setupTABLE[column][3][align=middle]"
+ , "\\setupTABLE[column][4][align=left]"
+ , "\\bTABLE"
+ , "\\bTABLEhead"
+ , "\\bTR"
+ , "\\bTH Right\\eTH"
+ , "\\bTH Left\\eTH"
+ , "\\bTH Center\\eTH"
+ , "\\bTH Default\\eTH"
+ , "\\eTR"
+ , "\\eTABLEhead"
+ , "\\bTABLEbody"
+ , "\\bTR"
+ , "\\bTD 1.1\\eTD"
+ , "\\bTD 1.2\\eTD"
+ , "\\bTD 1.3\\eTD"
+ , "\\bTD 1.4\\eTD"
+ , "\\eTR"
+ , "\\bTR"
+ , "\\bTD 2.1\\eTD"
+ , "\\bTD 2.2\\eTD"
+ , "\\bTD 2.3\\eTD"
+ , "\\bTD 2.4\\eTD"
+ , "\\eTR"
+ , "\\bTR"
+ , "\\bTD 3.1\\eTD"
+ , "\\bTD 3.2\\eTD"
+ , "\\bTD 3.3\\eTD"
+ , "\\bTD 3.4\\eTD"
+ , "\\eTR"
+ , "\\eTABLEbody"
+ , "\\bTABLEfoot"
+ , "\\eTABLEfoot"
+ , "\\eTABLE"
, "\\stopplacetable" ]
]
]
diff --git a/test/tables.context b/test/tables.context
index 556d2c216..22486ca91 100644
--- a/test/tables.context
+++ b/test/tables.context
@@ -3,12 +3,14 @@ Simple table with caption:
\startplacetable[title={Demonstration of simple table syntax.}]
\startxtable
\startxtablehead[head]
+\startxrowgroup[lastrow]
\startxrow
\startxcell[align=left] Right \stopxcell
\startxcell[align=right] Left \stopxcell
\startxcell[align=middle] Center \stopxcell
\startxcell Default \stopxcell
\stopxrow
+\stopxrowgroup
\stopxtablehead
\startxtablebody[body]
\startxrow
@@ -23,14 +25,16 @@ Simple table with caption:
\startxcell[align=middle] 123 \stopxcell
\startxcell 123 \stopxcell
\stopxrow
-\stopxtablebody
-\startxtablefoot[foot]
+\startxrowgroup[lastrow]
\startxrow
\startxcell[align=left] 1 \stopxcell
\startxcell[align=right] 1 \stopxcell
\startxcell[align=middle] 1 \stopxcell
\startxcell 1 \stopxcell
\stopxrow
+\stopxrowgroup
+\stopxtablebody
+\startxtablefoot[foot]
\stopxtablefoot
\stopxtable
\stopplacetable
@@ -40,12 +44,14 @@ Simple table without caption:
\startplacetable[location=none]
\startxtable
\startxtablehead[head]
+\startxrowgroup[lastrow]
\startxrow
\startxcell[align=left] Right \stopxcell
\startxcell[align=right] Left \stopxcell
\startxcell[align=middle] Center \stopxcell
\startxcell Default \stopxcell
\stopxrow
+\stopxrowgroup
\stopxtablehead
\startxtablebody[body]
\startxrow
@@ -60,14 +66,16 @@ Simple table without caption:
\startxcell[align=middle] 123 \stopxcell
\startxcell 123 \stopxcell
\stopxrow
-\stopxtablebody
-\startxtablefoot[foot]
+\startxrowgroup[lastrow]
\startxrow
\startxcell[align=left] 1 \stopxcell
\startxcell[align=right] 1 \stopxcell
\startxcell[align=middle] 1 \stopxcell
\startxcell 1 \stopxcell
\stopxrow
+\stopxrowgroup
+\stopxtablebody
+\startxtablefoot[foot]
\stopxtablefoot
\stopxtable
\stopplacetable
@@ -77,12 +85,14 @@ Simple table indented two spaces:
\startplacetable[title={Demonstration of simple table syntax.}]
\startxtable
\startxtablehead[head]
+\startxrowgroup[lastrow]
\startxrow
\startxcell[align=left] Right \stopxcell
\startxcell[align=right] Left \stopxcell
\startxcell[align=middle] Center \stopxcell
\startxcell Default \stopxcell
\stopxrow
+\stopxrowgroup
\stopxtablehead
\startxtablebody[body]
\startxrow
@@ -97,14 +107,16 @@ Simple table indented two spaces:
\startxcell[align=middle] 123 \stopxcell
\startxcell 123 \stopxcell
\stopxrow
-\stopxtablebody
-\startxtablefoot[foot]
+\startxrowgroup[lastrow]
\startxrow
\startxcell[align=left] 1 \stopxcell
\startxcell[align=right] 1 \stopxcell
\startxcell[align=middle] 1 \stopxcell
\startxcell 1 \stopxcell
\stopxrow
+\stopxrowgroup
+\stopxtablebody
+\startxtablefoot[foot]
\stopxtablefoot
\stopxtable
\stopplacetable
@@ -114,12 +126,14 @@ Multiline table with caption:
\startplacetable[title={Here's the caption. It may span multiple lines.}]
\startxtable
\startxtablehead[head]
+\startxrowgroup[lastrow]
\startxrow
\startxcell[align=middle,width={0.15\textwidth}] Centered Header \stopxcell
\startxcell[align=right,width={0.14\textwidth}] Left Aligned \stopxcell
\startxcell[align=left,width={0.16\textwidth}] Right Aligned \stopxcell
\startxcell[align=right,width={0.35\textwidth}] Default aligned \stopxcell
\stopxrow
+\stopxrowgroup
\stopxtablehead
\startxtablebody[body]
\startxrow
@@ -129,8 +143,7 @@ Multiline table with caption:
\startxcell[align=right,width={0.35\textwidth}] Example of a row that spans
multiple lines. \stopxcell
\stopxrow
-\stopxtablebody
-\startxtablefoot[foot]
+\startxrowgroup[lastrow]
\startxrow
\startxcell[align=middle,width={0.15\textwidth}] Second \stopxcell
\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
@@ -138,6 +151,9 @@ multiple lines. \stopxcell
\startxcell[align=right,width={0.35\textwidth}] Here's another one. Note the
blank line between rows. \stopxcell
\stopxrow
+\stopxrowgroup
+\stopxtablebody
+\startxtablefoot[foot]
\stopxtablefoot
\stopxtable
\stopplacetable
@@ -147,12 +163,14 @@ Multiline table without caption:
\startplacetable[location=none]
\startxtable
\startxtablehead[head]
+\startxrowgroup[lastrow]
\startxrow
\startxcell[align=middle,width={0.15\textwidth}] Centered Header \stopxcell
\startxcell[align=right,width={0.14\textwidth}] Left Aligned \stopxcell
\startxcell[align=left,width={0.16\textwidth}] Right Aligned \stopxcell
\startxcell[align=right,width={0.35\textwidth}] Default aligned \stopxcell
\stopxrow
+\stopxrowgroup
\stopxtablehead
\startxtablebody[body]
\startxrow
@@ -162,8 +180,7 @@ Multiline table without caption:
\startxcell[align=right,width={0.35\textwidth}] Example of a row that spans
multiple lines. \stopxcell
\stopxrow
-\stopxtablebody
-\startxtablefoot[foot]
+\startxrowgroup[lastrow]
\startxrow
\startxcell[align=middle,width={0.15\textwidth}] Second \stopxcell
\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
@@ -171,6 +188,9 @@ multiple lines. \stopxcell
\startxcell[align=right,width={0.35\textwidth}] Here's another one. Note the
blank line between rows. \stopxcell
\stopxrow
+\stopxrowgroup
+\stopxtablebody
+\startxtablefoot[foot]
\stopxtablefoot
\stopxtable
\stopplacetable
@@ -179,6 +199,8 @@ Table without column headers:
\startplacetable[location=none]
\startxtable
+\startxtablehead[head]
+\stopxtablehead
\startxtablebody[body]
\startxrow
\startxcell[align=left] 12 \stopxcell
@@ -192,14 +214,16 @@ Table without column headers:
\startxcell[align=middle] 123 \stopxcell
\startxcell[align=left] 123 \stopxcell
\stopxrow
-\stopxtablebody
-\startxtablefoot[foot]
+\startxrowgroup[lastrow]
\startxrow
\startxcell[align=left] 1 \stopxcell
\startxcell[align=right] 1 \stopxcell
\startxcell[align=middle] 1 \stopxcell
\startxcell[align=left] 1 \stopxcell
\stopxrow
+\stopxrowgroup
+\stopxtablebody
+\startxtablefoot[foot]
\stopxtablefoot
\stopxtable
\stopplacetable
@@ -208,6 +232,8 @@ Multiline table without column headers:
\startplacetable[location=none]
\startxtable
+\startxtablehead[head]
+\stopxtablehead
\startxtablebody[body]
\startxrow
\startxcell[align=middle,width={0.15\textwidth}] First \stopxcell
@@ -216,8 +242,7 @@ Multiline table without column headers:
\startxcell[width={0.35\textwidth}] Example of a row that spans multiple
lines. \stopxcell
\stopxrow
-\stopxtablebody
-\startxtablefoot[foot]
+\startxrowgroup[lastrow]
\startxrow
\startxcell[align=middle,width={0.15\textwidth}] Second \stopxcell
\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
@@ -225,6 +250,9 @@ lines. \stopxcell
\startxcell[width={0.35\textwidth}] Here's another one. Note the blank line
between rows. \stopxcell
\stopxrow
+\stopxrowgroup
+\stopxtablebody
+\startxtablefoot[foot]
\stopxtablefoot
\stopxtable
\stopplacetable
diff --git a/test/writer.context b/test/writer.context
index 0844520fb..540bbce24 100644
--- a/test/writer.context
+++ b/test/writer.context
@@ -60,9 +60,10 @@
\setupfloat[table][default={here,nonumber}]
\setupxtable[frame=off]
-\setupxtable[head][topframe=on,bottomframe=on]
+\setupxtable[head][topframe=on]
\setupxtable[body][]
-\setupxtable[foot][bottomframe=on]
+\setupxtable[foot][]
+\setupxtable[lastrow][bottomframe=on]
\starttext
diff --git a/test/writers-lang-and-dir.context b/test/writers-lang-and-dir.context
index c8ce6e815..90bcc1275 100644
--- a/test/writers-lang-and-dir.context
+++ b/test/writers-lang-and-dir.context
@@ -58,9 +58,10 @@
\setupfloat[table][default={here,nonumber}]
\setupxtable[frame=off]
-\setupxtable[head][topframe=on,bottomframe=on]
+\setupxtable[head][topframe=on]
\setupxtable[body][]
-\setupxtable[foot][bottomframe=on]
+\setupxtable[foot][]
+\setupxtable[lastrow][bottomframe=on]
\starttext