Skip to content
Snippets Groups Projects
Commit 4e9aa92d authored by Mateusz Kowalczyk's avatar Mateusz Kowalczyk
Browse files

Ignore version string during HTML tests.

parent 81c379da
No related branches found
No related tags found
No related merge requests found
...@@ -134,9 +134,21 @@ check modules strict = do ...@@ -134,9 +134,21 @@ check modules strict = do
else do else do
putStrLn $ "Pass: " ++ mod ++ " (no .ref file)" putStrLn $ "Pass: " ++ mod ++ " (no .ref file)"
-- | A rather nasty way to drop the Haddock version string from the
-- end of the generated HTML files so that we don't have to change
-- every single test every time we change versions. We rely on the the
-- last paragraph of the document to be the version. We end up with
-- malformed HTML but we don't care as we never look at it ourselves.
dropVersion :: String -> String
dropVersion = reverse . dropTillP . reverse
where
dropTillP [] = []
dropTillP ('p':'<':xs) = xs
dropTillP (_:xs) = dropTillP xs
haddockEq :: String -> String -> Bool haddockEq :: String -> String -> Bool
haddockEq file1 file2 = stripLinks file1 == stripLinks file2 haddockEq file1 file2 =
stripLinks (dropVersion file1) == stripLinks (dropVersion file2)
stripLinks :: String -> String stripLinks :: String -> String
stripLinks str = stripLinks str =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment