summaryrefslogtreecommitdiff
path: root/tests/Tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-06-29 23:03:12 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-06-29 23:05:08 -0700
commit3fbbafd391334429df49255160ace17245409e41 (patch)
tree6763f46d3a26f74efab58f9cab58d195fee73e01 /tests/Tests
parentaad618d9dbd68d5ea625945d23674befddf3a072 (diff)
Rewrote normalize for efficiency. (Closes #1385.)
* Added normalizeInlines, normalizeBlocks. * Type signature is now more narrow, `Pandoc -> Pandoc` instead of `Data a :: a -> a`. Some users may need to change their uses of `normalize` to the newly exported `normalizeInlines` or `normalizeBlocks`.
Diffstat (limited to 'tests/Tests')
-rw-r--r--tests/Tests/Shared.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/Tests/Shared.hs b/tests/Tests/Shared.hs
index f4bf13da4..8c7c31674 100644
--- a/tests/Tests/Shared.hs
+++ b/tests/Tests/Shared.hs
@@ -16,11 +16,13 @@ tests = [ testGroup "normalize"
]
p_normalize_blocks_rt :: [Block] -> Bool
-p_normalize_blocks_rt bs = normalize bs == normalize (normalize bs)
+p_normalize_blocks_rt bs =
+ normalizeBlocks bs == normalizeBlocks (normalizeBlocks bs)
p_normalize_inlines_rt :: [Inline] -> Bool
-p_normalize_inlines_rt ils = normalize ils == normalize (normalize ils)
+p_normalize_inlines_rt ils =
+ normalizeInlines ils == normalizeInlines (normalizeInlines ils)
p_normalize_no_trailing_spaces :: [Inline] -> Bool
p_normalize_no_trailing_spaces ils = null ils' || last ils' /= Space
- where ils' = normalize $ ils ++ [Space]
+ where ils' = normalizeInlines $ ils ++ [Space]