Permalink
Browse files

testing update

  • Loading branch information...
1 parent 1830241 commit 0b11f6221888597f02fbc4c2fa226f217c1cb6b3 Arjun Guha committed Apr 11, 2009
Showing with 5 additions and 34 deletions.
  1. +2 −1 src/BrownPLT/Test.hs
  2. +2 −2 tests/MozSuite.hs
  3. +0 −30 tests/ParsePretty.hs
  4. +1 −1 tests/Rhino.hs
View
3 src/BrownPLT/Test.hs
@@ -7,6 +7,7 @@ module BrownPLT.Test
, commandIO
, rhinoIO
, rhinoIOFile
+ , SourcePos
, module Test.HUnit
) where
@@ -39,7 +40,7 @@ import BrownPLT.JavaScript.Parser (parseScriptFromString,parseJavaScriptFromFile
ParsedStatement)
pretty :: [ParsedStatement] -> String
-pretty stmts = renderStatements
+pretty stmts = renderStatements stmts
isPrettyPrintError :: ParseError -> Bool
isPrettyPrintError pe =
View
4 tests/MozSuite.hs
@@ -6,8 +6,8 @@ import System.FilePath
import System.Directory
import Control.Monad
-import WebBits.Test
-import WebBits.JavaScript
+import BrownPLT.Test
+import BrownPLT.JavaScript
import qualified Data.ByteString.Char8 as B
isTestCall :: Statement SourcePos -> Bool
View
30 tests/ParsePretty.hs
@@ -1,30 +0,0 @@
-module ParsePretty where
-
-import Control.Monad ( liftM )
-
-import Test.HUnit.Base
-import Test.HUnit.Text
-import Data.Data
-
-import WebBits.Test
-
-
-eraseSourcePos x = fmap (const ()) x
-
-assertEqualWithoutSourcePos lhs rhs =
- case eraseSourcePos lhs == eraseSourcePos rhs of
- True -> return ()
- False -> assertFailure $ "expected:\n" ++ show lhs ++ "\ngot:\n" ++
- show rhs ++ "\n"
-
-testParsePrettyIdentity :: FilePath -> String -> Test
-testParsePrettyIdentity src str = TestCase $
- assertEqualWithoutSourcePos lhs rhs where
- lhs = ((parse (src ++ " (PRETTY-PRINTING)")) . pretty . (parse src)) str
- rhs = parse src str
-
-main = do
- testPaths <- liftM concat $ mapM getJsPaths ["parse-pretty", "libs"]
- testData <- mapM readFile testPaths
- let tests = zipWith testParsePrettyIdentity testPaths testData
- return (TestList tests)
View
2 tests/Rhino.hs
@@ -5,7 +5,7 @@ module Rhino where
import Control.Monad
import qualified Data.ByteString.Char8 as B
-import WebBits.Test
+import BrownPLT.Test

0 comments on commit 0b11f62

Please sign in to comment.