Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

testing update

  • Loading branch information...
commit 0b11f6221888597f02fbc4c2fa226f217c1cb6b3 1 parent 1830241
Arjun Guha authored
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.
Something went wrong with that request. Please try again.