summaryrefslogtreecommitdiff
path: root/src/Tests/Shared.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-02-04 13:22:31 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-02-04 13:43:38 -0800
commit70405ef98ab48e76e9cc8cdd827cb7580dacf4e6 (patch)
tree98acdaa5c5e8e9d2d8b1f735b8daa62ffef16f53 /src/Tests/Shared.hs
parent8e81437fd1ad7e2fab200af722c86b2b265af818 (diff)
normalize: Normalize spaces too.
In normal form, Space elements only occur to separate two non-Space elements. So, we never have [Space], or [, ..., Space].
Diffstat (limited to 'src/Tests/Shared.hs')
-rw-r--r--src/Tests/Shared.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Tests/Shared.hs b/src/Tests/Shared.hs
index c35a158c1..f4bf13da4 100644
--- a/src/Tests/Shared.hs
+++ b/src/Tests/Shared.hs
@@ -10,6 +10,8 @@ tests :: [Test]
tests = [ testGroup "normalize"
[ property "p_normalize_blocks_rt" p_normalize_blocks_rt
, property "p_normalize_inlines_rt" p_normalize_inlines_rt
+ , property "p_normalize_no_trailing_spaces"
+ p_normalize_no_trailing_spaces
]
]
@@ -19,3 +21,6 @@ p_normalize_blocks_rt bs = normalize bs == normalize (normalize bs)
p_normalize_inlines_rt :: [Inline] -> Bool
p_normalize_inlines_rt ils = normalize ils == normalize (normalize ils)
+p_normalize_no_trailing_spaces :: [Inline] -> Bool
+p_normalize_no_trailing_spaces ils = null ils' || last ils' /= Space
+ where ils' = normalize $ ils ++ [Space]