aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Writers
diff options
context:
space:
mode:
Diffstat (limited to 'test/Tests/Writers')
-rw-r--r--test/Tests/Writers/ConTeXt.hs11
-rw-r--r--test/Tests/Writers/Muse.hs24
2 files changed, 24 insertions, 11 deletions
diff --git a/test/Tests/Writers/ConTeXt.hs b/test/Tests/Writers/ConTeXt.hs
index 082ff12fe..c747e5d2f 100644
--- a/test/Tests/Writers/ConTeXt.hs
+++ b/test/Tests/Writers/ConTeXt.hs
@@ -98,8 +98,8 @@ tests = [ testGroup "inline code"
]
, testGroup "natural tables"
[ test contextNtb "table with header and caption" $
- let caption = text "Table 1"
- aligns = [(AlignRight, 0.0), (AlignLeft, 0.0), (AlignCenter, 0.0), (AlignDefault, 0.0)]
+ let capt = text "Table 1"
+ aligns = [(AlignRight, ColWidthDefault), (AlignLeft, ColWidthDefault), (AlignCenter, ColWidthDefault), (AlignDefault, ColWidthDefault)]
headers = [plain $ text "Right",
plain $ text "Left",
plain $ text "Center",
@@ -116,7 +116,12 @@ tests = [ testGroup "inline code"
plain $ text "3.2",
plain $ text "3.3",
plain $ text "3.4"]]
- in table caption 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 ee61d18e0..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,0.0),(AlignDefault,0.0)]
- [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 caption = "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 caption [(AlignDefault,0.0),(AlignDefault,0.0)]
- 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"