aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Writers
diff options
context:
space:
mode:
Diffstat (limited to 'test/Tests/Writers')
-rw-r--r--test/Tests/Writers/ConTeXt.hs7
-rw-r--r--test/Tests/Writers/Muse.hs24
2 files changed, 22 insertions, 9 deletions
diff --git a/test/Tests/Writers/ConTeXt.hs b/test/Tests/Writers/ConTeXt.hs
index cc90b95a9..c747e5d2f 100644
--- a/test/Tests/Writers/ConTeXt.hs
+++ b/test/Tests/Writers/ConTeXt.hs
@@ -116,7 +116,12 @@ tests = [ testGroup "inline code"
plain $ text "3.2",
plain $ text "3.3",
plain $ text "3.4"]]
- in table capt aligns headers rows
+ toRow = Row nullAttr . map simpleCell
+ in table (simpleCaption $ plain capt)
+ aligns
+ (TableHead nullAttr [toRow headers])
+ [TableBody nullAttr 0 [] $ map toRow rows]
+ (TableFoot nullAttr [])
=?> unlines [ "\\startplacetable[title={Table 1}]"
, "\\startTABLE"
, "\\startTABLEhead"
diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs
index 42748ad85..d0df0799f 100644
--- a/test/Tests/Writers/Muse.hs
+++ b/test/Tests/Writers/Muse.hs
@@ -372,8 +372,12 @@ tests = [ testGroup "block elements"
[ "table without header" =:
let rows = [[para "Para 1.1", para "Para 1.2"]
,[para "Para 2.1", para "Para 2.2"]]
- in table mempty [(AlignDefault,ColWidthDefault),(AlignDefault,ColWidthDefault)]
- [mempty, mempty] rows
+ toRow = Row nullAttr . map simpleCell
+ in table emptyCaption
+ [(AlignDefault,ColWidthDefault),(AlignDefault,ColWidthDefault)]
+ (TableHead nullAttr [toRow [mempty, mempty]])
+ [TableBody nullAttr 0 [] $ map toRow rows]
+ (TableFoot nullAttr [])
=?>
unlines [ " Para 1.1 | Para 1.2"
, " Para 2.1 | Para 2.2"
@@ -389,12 +393,16 @@ tests = [ testGroup "block elements"
, " Para 2.1 | Para 2.2"
]
, "table with header and caption" =:
- let capt = "Table 1"
- headers = [plain "header 1", plain "header 2"]
- rows = [[para "Para 1.1", para "Para 1.2"]
- ,[para "Para 2.1", para "Para 2.2"]]
- in table capt [(AlignDefault,ColWidthDefault),(AlignDefault,ColWidthDefault)]
- headers rows
+ let capt = simpleCaption $ plain "Table 1"
+ toRow = Row nullAttr . map simpleCell
+ headers = [toRow [plain "header 1", plain "header 2"]]
+ rows = map toRow [[para "Para 1.1", para "Para 1.2"]
+ ,[para "Para 2.1", para "Para 2.2"]]
+ in table capt
+ [(AlignDefault,ColWidthDefault),(AlignDefault,ColWidthDefault)]
+ (TableHead nullAttr headers)
+ [TableBody nullAttr 0 [] rows]
+ (TableFoot nullAttr [])
=?> unlines [ " header 1 || header 2"
, " Para 1.1 | Para 1.2"
, " Para 2.1 | Para 2.2"