Repository : ssh://darcs.haskell.org//srv/darcs/haddock

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/3bdd9282ce67d1094c36204e77e3f32356a2c059

>---------------------------------------------------------------

commit 3bdd9282ce67d1094c36204e77e3f32356a2c059
Author: David Waern <david.wa...@gmail.com>
Date:   Fri Nov 25 02:16:20 2011 +0100

    Some more changes to test scripts.

>---------------------------------------------------------------

 tests/html-tests/copy.hs     |   10 ++++++++--
 tests/html-tests/runtests.hs |    2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/html-tests/copy.hs b/tests/html-tests/copy.hs
index fa18fe9..fe1e542 100644
--- a/tests/html-tests/copy.hs
+++ b/tests/html-tests/copy.hs
@@ -5,7 +5,6 @@ import System.Exit
 import System.Directory
 import Data.List
 import Control.Monad
-import Text.Regex
 
 
 main = do
@@ -27,4 +26,11 @@ copy file = do
   writeFile new (stripLinks contents)
 
 
-stripLinks f = subRegex (mkRegexWithOpts "<A HREF=[^>]*>" False False) f "<A 
HREF=\"\">"
+stripLinks str =
+  let prefix = "<a href=\"" in
+  case stripPrefix prefix str of
+    Just str' -> prefix ++ stripLinks (dropWhile (/= '"') str')
+    Nothing ->
+      case str of
+        [] -> []
+        x : xs -> x : stripLinks xs
diff --git a/tests/html-tests/runtests.hs b/tests/html-tests/runtests.hs
index 35de8c0..25e53d1 100644
--- a/tests/html-tests/runtests.hs
+++ b/tests/html-tests/runtests.hs
@@ -32,7 +32,7 @@ main = do
 
 test = do
   x <- doesFileExist haddockPath
-  when (not x) $ die "you need to run 'cabal build' successfully first"
+  unless x $ die "you need to run 'cabal build' successfully first"
 
   contents <- getDirectoryContents testDir
   args <- getArgs



_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to