From 86cf889e7d746f68d65900f3b5f0d31b24aef7bf Mon Sep 17 00:00:00 2001 From: David Waern Date: Sat, 5 Nov 2011 20:37:29 +0100 Subject: Rename copy.hs -> accept.hs. --- tests/html-tests/accept.hs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/html-tests/accept.hs (limited to 'tests/html-tests/accept.hs') diff --git a/tests/html-tests/accept.hs b/tests/html-tests/accept.hs new file mode 100644 index 00000000..fa18fe9c --- /dev/null +++ b/tests/html-tests/accept.hs @@ -0,0 +1,30 @@ +import System.Cmd +import System.Environment +import System.FilePath +import System.Exit +import System.Directory +import Data.List +import Control.Monad +import Text.Regex + + +main = do + args <- getArgs + dir <- getCurrentDirectory + contents <- getDirectoryContents (dir "output") + if not $ null args + then + mapM copy [ "output" file | file <- contents, ".html" `isSuffixOf` file, takeBaseName file `elem` args ] + else + mapM copy [ "output" file | file <- contents, ".html" `isSuffixOf` file ] + + +copy file = do + let new = "tests" takeFileName file <.> ".ref" + print file + print new + contents <- readFile file + writeFile new (stripLinks contents) + + +stripLinks f = subRegex (mkRegexWithOpts "]*>" False False) f "" -- cgit v1.2.3