aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests/Writers/Plain.hs
diff options
context:
space:
mode:
authorArtyom Kazak <yom@artyom.me>2014-08-03 16:48:55 +0400
committerArtyom Kazak <yom@artyom.me>2014-08-03 17:37:37 +0400
commitec88d47f23d6761cf2120f76e45ca23cdc478e6c (patch)
tree97506dc41a66d0050b94d4a1c086c9e28d2a7927 /tests/Tests/Writers/Plain.hs
parent842c705097fbb3987145eae85da2261cb264e618 (diff)
downloadpandoc-ec88d47f23d6761cf2120f76e45ca23cdc478e6c.tar.gz
Correctly implement capitalisation.
Using `map toUpper` to capitalise text is wrong, as e.g. “Straße” should be converted to “STRASSE”, which is 1 character longer. This commit adds a `capitalize` function and replaces 2 identical implementations in different modules (`toCaps` and `capitalize`) with it.
Diffstat (limited to 'tests/Tests/Writers/Plain.hs')
-rw-r--r--tests/Tests/Writers/Plain.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/Tests/Writers/Plain.hs b/tests/Tests/Writers/Plain.hs
new file mode 100644
index 000000000..f8f1d3d90
--- /dev/null
+++ b/tests/Tests/Writers/Plain.hs
@@ -0,0 +1,21 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Tests.Writers.Plain (tests) where
+
+import Test.Framework
+import Text.Pandoc.Builder
+import Text.Pandoc
+import Tests.Helpers
+import Tests.Arbitrary()
+
+
+infix 4 =:
+(=:) :: (ToString a, ToPandoc a)
+ => String -> (a, String) -> Test
+(=:) = test (writePlain def . toPandoc)
+
+
+tests :: [Test]
+tests = [ "strongly emphasized text to uppercase"
+ =: strong "Straße"
+ =?> "STRASSE"
+ ]