aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChristian Despres <50160106+despresc@users.noreply.github.com>2021-11-11 23:55:37 -0500
committerGitHub <noreply@github.com>2021-11-11 20:55:37 -0800
commitabdfefebdf9ffd338683adb1d4fcfe6db4909b49 (patch)
treee264d6fb8cf598b388c5af5edb7a4e7d892b99b0 /test
parentebf7f782d3151956d6e886c9615580c0b67f6656 (diff)
downloadpandoc-abdfefebdf9ffd338683adb1d4fcfe6db4909b49.tar.gz
Writers.Shared: Improve toLegacyTable.
Closes #7683. (PR #7684)
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Shared.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Tests/Shared.hs b/test/Tests/Shared.hs
index e415ea153..5365812fe 100644
--- a/test/Tests/Shared.hs
+++ b/test/Tests/Shared.hs
@@ -56,6 +56,7 @@ testLegacyTable :: [TestTree]
testLegacyTable =
[ testCase "decomposes a table with head" $ gen1 @?= expect1
, testCase "decomposes a table without head" $ gen2 @?= expect2
+ , testCase "decomposes the table from issue 7683" $ gen3 @?= expect3
]
where
pln = toList . plain . str
@@ -110,3 +111,18 @@ testLegacyTable =
,[pln "j", mempty, mempty]]
)
gen2 = toLegacyTable emptyCaption spec1 (th []) [body1] (tf footRows1)
+
+ spec3 = replicate 4 (AlignDefault, ColWidthDefault)
+ body3 = tb 0
+ []
+ [[cl "a" 2 1, cl "b" 1 2, cl "c" 2 1]
+ ,[cl "d" 1 1, cl "e" 1 1]
+ ]
+ expect3 = ( []
+ , replicate 4 AlignDefault
+ , replicate 4 0
+ , []
+ , [[pln "a", pln "b", mempty, pln "c"]
+ ,[mempty, pln "d", pln "e", mempty]]
+ )
+ gen3 = toLegacyTable emptyCaption spec3 (th []) [body3] (tf [])