summaryrefslogtreecommitdiff
path: root/test/Tests
diff options
context:
space:
mode:
authorBrian Leung <29217594+leungbk@users.noreply.github.com>2022-05-02 08:25:57 -0700
committerGitHub <noreply@github.com>2022-05-02 17:25:57 +0200
commit67daf96bdd519b1e709d6ed2534d06203967bf97 (patch)
tree94a3ace6f960e26e772c00437f3ff9af7112f2b3 /test/Tests
parent843eeae13d4cb2a7e8c1ed0d151a691c83adf72f (diff)
Org reader: allow attrs for Org tables. (#8049)
Tables with attributes are no longer wrapped in Div elements; attributes are added directly to the table element.
Diffstat (limited to 'test/Tests')
-rw-r--r--test/Tests/Readers/Org/Block/Table.hs23
1 files changed, 15 insertions, 8 deletions
diff --git a/test/Tests/Readers/Org/Block/Table.hs b/test/Tests/Readers/Org/Block/Table.hs
index 5a9320b4a..f6b99a5c1 100644
--- a/test/Tests/Readers/Org/Block/Table.hs
+++ b/test/Tests/Readers/Org/Block/Table.hs
@@ -25,12 +25,16 @@ simpleTable' :: Int
simpleTable' n = simpleTable'' emptyCaption $ replicate n (AlignDefault, ColWidthDefault)
simpleTable'' :: Caption -> [ColSpec] -> [Blocks] -> [[Blocks]] -> Blocks
-simpleTable'' capt spec headers rows
- = table capt
- spec
- (TableHead nullAttr $ toHeaderRow headers)
- [TableBody nullAttr 0 [] $ map toRow rows]
- (TableFoot nullAttr [])
+simpleTable'' = simpleTableWith'' (mempty, [], [])
+
+simpleTableWith'' :: Attr -> Caption -> [ColSpec] -> [Blocks] -> [[Blocks]] -> Blocks
+simpleTableWith'' attr capt spec headers rows
+ = tableWith attr
+ capt
+ spec
+ (TableHead nullAttr $ toHeaderRow headers)
+ [TableBody nullAttr 0 [] $ map toRow rows]
+ (TableFoot nullAttr [])
where
toRow = Row nullAttr . map simpleCell
toHeaderRow l = [toRow l | not (null l)]
@@ -181,6 +185,9 @@ tests =
T.unlines [ "#+name: x-marks-the-spot"
, "| x |"
] =?>
- divWith ("x-marks-the-spot", mempty, mempty)
- (simpleTable' 1 mempty [ [ plain "x" ] ])
+ simpleTableWith'' ("x-marks-the-spot", mempty, mempty)
+ emptyCaption
+ (replicate 1 (AlignDefault, ColWidthDefault))
+ mempty
+ [ [ plain "x" ] ]
]