summaryrefslogtreecommitdiff
path: root/test/Tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2022-10-24 22:58:03 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2022-10-24 22:58:03 -0700
commit368f3fd71fb570278f3a3af20547d63525444cfe (patch)
tree0156b10b972e450170e4260a4955b8f004bd4c57 /test/Tests
parente6866c1543b11b7b0301b0d5e4d0fd3603237c0b (diff)
Rename T.P.Readers.Odt -> T.P.Readers.ODT.
For consistency with Writers.ODT. Similarly, rename `readOdt` -> `readODT`. [API change]
Diffstat (limited to 'test/Tests')
-rw-r--r--test/Tests/Readers/ODT.hs (renamed from test/Tests/Readers/Odt.hs)30
1 files changed, 15 insertions, 15 deletions
diff --git a/test/Tests/Readers/Odt.hs b/test/Tests/Readers/ODT.hs
index 8dcd7b29b..ce107af69 100644
--- a/test/Tests/Readers/Odt.hs
+++ b/test/Tests/Readers/ODT.hs
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
{- |
- Module : Tests.Readers.Odt
+ Module : Tests.Readers.ODT
Copyright : © 2015-2022 John MacFarlane
2015 Martin Linnemann
License : GNU GPL, version 2 or above
@@ -11,7 +11,7 @@
Tests for the ODT reader.
-}
-module Tests.Readers.Odt (tests) where
+module Tests.Readers.ODT (tests) where
import Control.Monad (liftM)
import qualified Data.ByteString as BS
@@ -33,21 +33,21 @@ tests = testsComparingToMarkdown ++ testsComparingToNative
testsComparingToMarkdown :: [TestTree]
testsComparingToMarkdown = map nameToTest namesOfTestsComparingToMarkdown
where nameToTest name = createTest
- compareOdtToMarkdown
+ compareODTToMarkdown
name
- (toOdtPath name)
+ (toODTPath name)
(toMarkdownPath name)
- toOdtPath name = "odt/odt/" ++ name ++ ".odt"
+ toODTPath name = "odt/odt/" ++ name ++ ".odt"
toMarkdownPath name = "odt/markdown/" ++ name ++ ".md"
testsComparingToNative :: [TestTree]
testsComparingToNative = map nameToTest namesOfTestsComparingToNative
where nameToTest name = createTest
- compareOdtToNative
+ compareODTToNative
name
- (toOdtPath name)
+ (toODTPath name)
(toNativePath name)
- toOdtPath name = "odt/odt/" ++ name ++ ".odt"
+ toODTPath name = "odt/odt/" ++ name ++ ".odt"
toNativePath name = "odt/native/" ++ name ++ ".native"
@@ -73,22 +73,22 @@ type TestCreator = ReaderOptions
-> FilePath -> FilePath
-> IO (NoNormPandoc, NoNormPandoc)
-compareOdtToNative :: TestCreator
-compareOdtToNative opts odtPath nativePath = do
+compareODTToNative :: TestCreator
+compareODTToNative opts odtPath nativePath = do
nativeFile <- UTF8.toText <$> BS.readFile nativePath
odtFile <- B.readFile odtPath
native <- getNoNormVia id "native" <$> runIO (readNative def nativeFile)
- odt <- getNoNormVia id "odt" <$> runIO (readOdt opts odtFile)
+ odt <- getNoNormVia id "odt" <$> runIO (readODT opts odtFile)
return (odt,native)
-compareOdtToMarkdown :: TestCreator
-compareOdtToMarkdown opts odtPath markdownPath = do
+compareODTToMarkdown :: TestCreator
+compareODTToMarkdown opts odtPath markdownPath = do
markdownFile <- UTF8.toText <$> BS.readFile markdownPath
odtFile <- B.readFile odtPath
markdown <- getNoNormVia id "markdown" <$>
runIO (readMarkdown def{ readerExtensions = pandocExtensions }
markdownFile)
- odt <- getNoNormVia id "odt" <$> runIO (readOdt opts odtFile)
+ odt <- getNoNormVia id "odt" <$> runIO (readODT opts odtFile)
return (odt,markdown)
@@ -125,7 +125,7 @@ compareMediaPathIO mediaPath mediaBag odtPath = do
compareMediaBagIO :: FilePath -> IO Bool
compareMediaBagIO odtFile = do
df <- B.readFile odtFile
- let (_, mb) = readOdt def df
+ let (_, mb) = readODT def df
bools <- mapM
(\(fp, _, _) -> compareMediaPathIO fp mb odtFile)
(mediaDirectory mb)