From a7cfb1d83c7e0f97a806e1f2c202416e625b2ce2 Mon Sep 17 00:00:00 2001 From: David Waern Date: Tue, 11 May 2010 19:14:31 +0000 Subject: Re-organise the testsuite structure --- tests/parsetests.hs | 56 ----------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 tests/parsetests.hs (limited to 'tests/parsetests.hs') diff --git a/tests/parsetests.hs b/tests/parsetests.hs deleted file mode 100644 index f66355e2..00000000 --- a/tests/parsetests.hs +++ /dev/null @@ -1,56 +0,0 @@ -module Main (main) where - -import Test.HUnit -import RdrName (RdrName) -import DynFlags (defaultDynFlags) -import Haddock.Lex (tokenise) -import Haddock.Parse (parseParas) -import Haddock.Types - -instance Show RdrName where - show x = "RdrName" - -data ParseTest = ParseTest { - input :: String - , result :: (Maybe (Doc RdrName)) - } - -tests :: [ParseTest] -tests = [ - ParseTest { - input = "foobar" - , result = Just $ DocParagraph $ DocString "foobar\n" - } - - , ParseTest { - input = "foobar\n\nghci> fib 10\n55" - , result = Just $ DocAppend (DocParagraph $ DocString "foobar\n") (DocExamples $ [Example "fib 10" ["55"]]) - } - - , ParseTest { - input = "foobar\nghci> fib 10\n55" - , result = Nothing -- parse error - } - - , ParseTest { - input = "foobar\n\n> some code" - , result = Just (DocAppend (DocParagraph (DocString "foobar\n")) (DocCodeBlock (DocString " some code\n"))) - } - - , ParseTest { - input = "foobar\n> some code" - , result = Nothing -- parse error - } - ] - - -main = do - _ <- runTestTT $ TestList $ map testFromParseTest tests - return (); - where - - testFromParseTest :: ParseTest -> Test - testFromParseTest (ParseTest input result) = TestCase $ assertEqual input (parse input) result - - parse :: String -> Maybe (Doc RdrName) - parse input = parseParas $ tokenise defaultDynFlags input (0,0) -- cgit v1.2.3