Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
haddock
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Glasgow Haskell Compiler
haddock
Commits
4e9aa92d
Commit
4e9aa92d
authored
11 years ago
by
Mateusz Kowalczyk
Browse files
Options
Downloads
Patches
Plain Diff
Ignore version string during HTML tests.
parent
81c379da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
html-test/run.lhs
+13
-1
13 additions, 1 deletion
html-test/run.lhs
with
13 additions
and
1 deletion
html-test/run.lhs
+
13
−
1
View file @
4e9aa92d
...
@@ -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 =
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment