@@ -7,13 +7,12 @@ import System.Exit
77import System.FilePath (joinPath, splitDirectories, (<.>), (</>))
88import System.IO (openTempFile, stderr)
99import System.Process (runProcess, waitForProcess)
10−import Test.Framework (Test, testGroup)
11−import Test.Framework.Providers.HUnit
12−import Test.HUnit (assertBool)
10+import Test.Tasty (TestTree, testGroup)
11+import Test.Tasty.HUnit
1312import Tests.Helpers hiding (test)
1413import qualified Text.Pandoc.UTF8 as UTF8
1514
16−tests :: [Test]
15+tests :: [TestTree]
1716tests = [ testGroup "markdown"
1817 [ testGroup "writer"
1918 $ writerTests "markdown" ++ lhsWriterTests "markdown"
@@ -152,7 +151,7 @@ readFile' :: FilePath -> IO String
152151readFile' f = do s <- UTF8.readFile f
153152 return $! (length s `seq` s)
154153
155−lhsWriterTests :: String -> [Test]
154+lhsWriterTests :: String -> [TestTree]
156155lhsWriterTests format
157156 = [ t "lhs to normal" format
158157 , t "lhs to lhs" (format ++ "+lhs")
@@ -161,7 +160,7 @@ lhsWriterTests format
161160 t n f = test n ["--wrap=preserve", "-r", "native", "-s", "-w", f]
162161 "lhs-test.native" ("lhs-test" <.> f)
163162
164−lhsReaderTest :: String -> Test
163+lhsReaderTest :: String -> TestTree
165164lhsReaderTest format =
166165 test "lhs" ["-r", format, "-w", "native"]
167166 ("lhs-test" <.> format) norm
@@ -169,7 +168,7 @@ lhsReaderTest format =
169168 then "lhs-test-markdown.native"
170169 else "lhs-test.native"
171170
172−writerTests :: String -> [Test]
171+writerTests :: String -> [TestTree]
173172writerTests format
174173 = [ test "basic" (opts ++ ["-s"]) "testsuite.native" ("writer" <.> format)
175174 , test "tables" opts "tables.native" ("tables" <.> format)
@@ -178,13 +177,13 @@ writerTests format
178177 opts = ["-r", "native", "-w", format, "--columns=78",
179178 "--variable", "pandoc-version="]
180179
181−s5WriterTest :: String -> [String] -> String -> Test
180+s5WriterTest :: String -> [String] -> String -> TestTree
182181s5WriterTest modifier opts format
183182 = test (format ++ " writer (" ++ modifier ++ ")")
184183 (["-r", "native", "-w", format] ++ opts)
185184 "s5.native" ("s5-" ++ modifier <.> "html")
186185
187−fb2WriterTest :: String -> [String] -> String -> String -> Test
186+fb2WriterTest :: String -> [String] -> String -> String -> TestTree
188187fb2WriterTest title opts inputfile normfile =
189188 testWithNormalize (ignoreBinary . formatXML)
190189 title (["-t", "fb2"]++opts) inputfile normfile
@@ -202,7 +201,7 @@ test :: String -- ^ Title of test
202201 -> [String] -- ^ Options to pass to pandoc
203202 -> String -- ^ Input filepath
204203 -> FilePath -- ^ Norm (for test results) filepath
205− -> Test
204+ -> TestTree
206205test = testWithNormalize id
207206
208207-- | Run a test with normalize function, return True if test passed.
@@ -211,7 +210,7 @@ testWithNormalize :: (String -> String) -- ^ Normalize function for output
211210 -> [String] -- ^ Options to pass to pandoc
212211 -> String -- ^ Input filepath
213212 -> FilePath -- ^ Norm (for test results) filepath
214− -> Test
213+ -> TestTree
215214testWithNormalize normalizer testname opts inp norm = testCase testname $ do
216215 -- find pandoc executable relative to test-pandoc
217216 -- First, try in same directory (e.g. if both in ~/.cabal/bin)