summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPhilFreeman <>2017-04-02 18:53:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-04-02 18:53:00 (GMT)
commit626d1473c5625f56af11d71581dbfd8b768bdb69 (patch)
treeb030c3a6e72cf0f7ae43da6ff2b8e8c002156bc1 /tests
parent7676ddc7b8f08b91dd3bb0be8ff823ee1a656809 (diff)
version 0.11.20.11.2
Diffstat (limited to 'tests')
-rw-r--r--tests/Language/PureScript/Ide/ImportsSpec.hs27
-rw-r--r--tests/Language/PureScript/Ide/ReexportsSpec.hs38
-rw-r--r--tests/Language/PureScript/Ide/SourceFileSpec.hs4
-rw-r--r--tests/Language/PureScript/Ide/StateSpec.hs6
-rw-r--r--tests/Language/PureScript/Ide/Test.hs12
-rw-r--r--tests/TestPsci.hs19
-rw-r--r--tests/TestPsci/CommandTest.hs51
-rw-r--r--tests/TestPsci/CompletionTest.hs16
-rw-r--r--tests/TestPsci/EvalTest.hs66
-rw-r--r--tests/TestPsci/TestEnv.hs6
10 files changed, 144 insertions, 101 deletions
diff --git a/tests/Language/PureScript/Ide/ImportsSpec.hs b/tests/Language/PureScript/Ide/ImportsSpec.hs
index b4aabeb..bb67e7d 100644
--- a/tests/Language/PureScript/Ide/ImportsSpec.hs
+++ b/tests/Language/PureScript/Ide/ImportsSpec.hs
@@ -56,9 +56,6 @@ listImport = testParseImport "import Data.List as List"
consoleImport = testParseImport "import Control.Monad.Eff.Console (log) as Console"
maybeImport = testParseImport "import Data.Maybe (Maybe(Just))"
-wildcard :: P.Type
-wildcard = P.TypeWildcard $ P.SourceSpan "" (P.SourcePos 0 0) (P.SourcePos 0 0)
-
spec :: Spec
spec = do
describe "determining the importsection" $ do
@@ -104,13 +101,13 @@ spec = do
describe "import commands" $ do
let simpleFileImports = let (_, _, i, _) = splitSimpleFile in i
addValueImport i mn is =
- prettyPrintImportSection (addExplicitImport' (IdeDeclValue (IdeValue (P.Ident i) wildcard)) mn is)
+ prettyPrintImportSection (addExplicitImport' (_idaDeclaration (Test.ideValue i Nothing)) mn is)
addOpImport op mn is =
- prettyPrintImportSection (addExplicitImport' (IdeDeclValueOperator (IdeValueOperator op (P.Qualified Nothing (Left (P.Ident ""))) 2 P.Infix Nothing)) mn is)
+ prettyPrintImportSection (addExplicitImport' (_idaDeclaration (Test.ideValueOp op (P.Qualified Nothing (Left "")) 2 Nothing Nothing)) mn is)
addDtorImport i t mn is =
- prettyPrintImportSection (addExplicitImport' (IdeDeclDataConstructor (IdeDataConstructor (P.ProperName i) t wildcard)) mn is)
+ prettyPrintImportSection (addExplicitImport' (_idaDeclaration (Test.ideDtor i t Nothing)) mn is)
addTypeImport i mn is =
- prettyPrintImportSection (addExplicitImport' (IdeDeclType (IdeType (P.ProperName i) P.kindType)) mn is)
+ prettyPrintImportSection (addExplicitImport' (_idaDeclaration (Test.ideType i Nothing)) mn is)
it "adds an implicit unqualified import to a file without any imports" $
shouldBe
(addImplicitImport' [] (P.moduleNameFromString "Data.Map"))
@@ -144,7 +141,7 @@ spec = do
]
it "adds an operator to an explicit import list" $
shouldBe
- (addOpImport (P.OpName "<~>") (P.moduleNameFromString "Data.Array") explicitImports)
+ (addOpImport "<~>" (P.moduleNameFromString "Data.Array") explicitImports)
[ "import Prelude"
, "import Data.Array (tail, (<~>))"
]
@@ -156,21 +153,21 @@ spec = do
]
it "adds the type for a given DataConstructor" $
shouldBe
- (addDtorImport "Just" (P.ProperName "Maybe") (P.moduleNameFromString "Data.Maybe") simpleFileImports)
+ (addDtorImport "Just" "Maybe" (P.moduleNameFromString "Data.Maybe") simpleFileImports)
[ "import Prelude"
, "import Data.Maybe (Maybe(..))"
]
it "adds a dataconstructor to an existing type import" $ do
let Right (_, _, typeImports, _) = sliceImportSection (withImports ["import Data.Maybe (Maybe)"])
shouldBe
- (addDtorImport "Just" (P.ProperName "Maybe") (P.moduleNameFromString "Data.Maybe") typeImports)
+ (addDtorImport "Just" "Maybe" (P.moduleNameFromString "Data.Maybe") typeImports)
[ "import Prelude"
, "import Data.Maybe (Maybe(..))"
]
it "doesn't add a dataconstructor to an existing type import with open dtors" $ do
let Right (_, _, typeImports, _) = sliceImportSection (withImports ["import Data.Maybe (Maybe(..))"])
shouldBe
- (addDtorImport "Just" (P.ProperName "Maybe") (P.moduleNameFromString "Data.Maybe") typeImports)
+ (addDtorImport "Just" "Maybe" (P.moduleNameFromString "Data.Maybe") typeImports)
[ "import Prelude"
, "import Data.Maybe (Maybe(..))"
]
@@ -186,10 +183,10 @@ spec = do
let Right (_, _, baseImports, _) = sliceImportSection $ withImports ["import Control.Monad (ap)"]
moduleName = (P.moduleNameFromString "Control.Monad")
addImport imports import' = addExplicitImport' import' moduleName imports
- valueImport ident = (IdeDeclValue (IdeValue (P.Ident ident) wildcard))
- typeImport name = (IdeDeclType (IdeType (P.ProperName name) P.kindType))
- classImport name = (IdeDeclTypeClass (IdeTypeClass (P.ProperName name) []))
- dtorImport name typeName = (IdeDeclDataConstructor (IdeDataConstructor (P.ProperName name) (P.ProperName typeName) wildcard))
+ valueImport ident = _idaDeclaration (Test.ideValue ident Nothing)
+ typeImport name = _idaDeclaration (Test.ideType name Nothing)
+ classImport name = _idaDeclaration (Test.ideTypeClass name P.kindType [])
+ dtorImport name typeName = _idaDeclaration (Test.ideDtor name typeName Nothing)
-- expect any list of provided identifiers, when imported, to come out as specified
expectSorted imports expected = shouldBe
(ordNub $ map
diff --git a/tests/Language/PureScript/Ide/ReexportsSpec.hs b/tests/Language/PureScript/Ide/ReexportsSpec.hs
index c810af8..198a08f 100644
--- a/tests/Language/PureScript/Ide/ReexportsSpec.hs
+++ b/tests/Language/PureScript/Ide/ReexportsSpec.hs
@@ -7,49 +7,39 @@ import Protolude
import qualified Data.Map as Map
import Language.PureScript.Ide.Reexports
import Language.PureScript.Ide.Types
+import Language.PureScript.Ide.Test
import qualified Language.PureScript as P
import Test.Hspec
-type Module = (P.ModuleName, [IdeDeclarationAnn])
-
-m :: Text -> P.ModuleName
-m = P.moduleNameFromString
-
-d :: IdeDeclaration -> IdeDeclarationAnn
-d = IdeDeclarationAnn emptyAnn
-
-exportedFrom :: Text -> IdeDeclarationAnn -> IdeDeclarationAnn
-exportedFrom mn (IdeDeclarationAnn ann decl) = IdeDeclarationAnn (ann {_annExportedFrom = Just (m mn)}) decl
-
valueA, typeA, classA, dtorA1, dtorA2 :: IdeDeclarationAnn
-valueA = d (IdeDeclValue (IdeValue (P.Ident "valueA") P.REmpty))
-typeA = d (IdeDeclType (IdeType(P.ProperName "TypeA") P.kindType))
-classA = d (IdeDeclTypeClass (IdeTypeClass (P.ProperName "ClassA") []))
-dtorA1 = d (IdeDeclDataConstructor (IdeDataConstructor (P.ProperName "DtorA1") (P.ProperName "TypeA") P.REmpty))
-dtorA2 = d (IdeDeclDataConstructor (IdeDataConstructor (P.ProperName "DtorA2") (P.ProperName "TypeA") P.REmpty))
+valueA = ideValue "valueA" Nothing
+typeA = ideType "TypeA" Nothing
+classA = ideTypeClass "ClassA" P.kindType []
+dtorA1 = ideDtor "DtorA1" "TypeA" Nothing
+dtorA2 = ideDtor "DtorA2" "TypeA" Nothing
env :: ModuleMap [IdeDeclarationAnn]
env = Map.fromList
- [ (m "A", [valueA, typeA, classA, dtorA1, dtorA2])
+ [ (mn "A", [valueA, typeA, classA, dtorA1, dtorA2])
]
type Refs = [(P.ModuleName, P.DeclarationRef)]
succTestCases :: [(Text, Refs, [IdeDeclarationAnn])]
succTestCases =
- [ ("resolves a value reexport", [(m "A", P.ValueRef (P.Ident "valueA"))], [exportedFrom "A" valueA])
+ [ ("resolves a value reexport", [(mn "A", P.ValueRef (P.Ident "valueA"))], [valueA `annExp` "A"])
, ("resolves a type reexport with explicit data constructors"
- , [(m "A", P.TypeRef (P.ProperName "TypeA") (Just [P.ProperName "DtorA1"]))], [exportedFrom "A" typeA, exportedFrom "A" dtorA1])
+ , [(mn "A", P.TypeRef (P.ProperName "TypeA") (Just [P.ProperName "DtorA1"]))], [typeA `annExp` "A", dtorA1 `annExp` "A"])
, ("resolves a type reexport with implicit data constructors"
- , [(m "A", P.TypeRef (P.ProperName "TypeA") Nothing)], map (exportedFrom "A") [typeA, dtorA1, dtorA2])
- , ("resolves a class reexport", [(m "A", P.TypeClassRef (P.ProperName "ClassA"))], [exportedFrom "A" classA])
+ , [(mn "A", P.TypeRef (P.ProperName "TypeA") Nothing)], map (`annExp` "A") [typeA, dtorA1, dtorA2])
+ , ("resolves a class reexport", [(mn "A", P.TypeClassRef (P.ProperName "ClassA"))], [classA `annExp` "A"])
]
failTestCases :: [(Text, Refs)]
failTestCases =
- [ ("fails to resolve a non existing value", [(m "A", P.ValueRef (P.Ident "valueB"))])
- , ("fails to resolve a non existing type reexport" , [(m "A", P.TypeRef (P.ProperName "TypeB") Nothing)])
- , ("fails to resolve a non existing class reexport", [(m "A", P.TypeClassRef (P.ProperName "ClassB"))])
+ [ ("fails to resolve a non existing value", [(mn "A", P.ValueRef (P.Ident "valueB"))])
+ , ("fails to resolve a non existing type reexport" , [(mn "A", P.TypeRef (P.ProperName "TypeB") Nothing)])
+ , ("fails to resolve a non existing class reexport", [(mn "A", P.TypeClassRef (P.ProperName "ClassB"))])
]
spec :: Spec
diff --git a/tests/Language/PureScript/Ide/SourceFileSpec.hs b/tests/Language/PureScript/Ide/SourceFileSpec.hs
index 6c760aa..50db451 100644
--- a/tests/Language/PureScript/Ide/SourceFileSpec.hs
+++ b/tests/Language/PureScript/Ide/SourceFileSpec.hs
@@ -97,12 +97,12 @@ getLocation s = do
ideState = emptyIdeState `s3`
[ ("Test",
[ ideValue "sfValue" Nothing `annLoc` valueSS
- , ideSynonym "SFType" P.tyString `annLoc` synonymSS
+ , ideSynonym "SFType" P.tyString P.kindType `annLoc` synonymSS
, ideType "SFData" Nothing `annLoc` typeSS
, ideDtor "SFOne" "SFData" Nothing `annLoc` typeSS
, ideDtor "SFTwo" "SFData" Nothing `annLoc` typeSS
, ideDtor "SFThree" "SFData" Nothing `annLoc` typeSS
- , ideTypeClass "SFClass" [] `annLoc` classSS
+ , ideTypeClass "SFClass" P.kindType [] `annLoc` classSS
, ideValueOp "<$>" (P.Qualified Nothing (Left "")) 0 Nothing Nothing
`annLoc` valueOpSS
, ideTypeOp "~>" (P.Qualified Nothing "") 0 Nothing Nothing
diff --git a/tests/Language/PureScript/Ide/StateSpec.hs b/tests/Language/PureScript/Ide/StateSpec.hs
index ac31866..78f8cea 100644
--- a/tests/Language/PureScript/Ide/StateSpec.hs
+++ b/tests/Language/PureScript/Ide/StateSpec.hs
@@ -6,6 +6,7 @@ import Protolude
import Control.Lens hiding ((&))
import Language.PureScript.Ide.Types
import Language.PureScript.Ide.State
+import Language.PureScript.Ide.Test
import qualified Language.PureScript as P
import Test.Hspec
import qualified Data.Map as Map
@@ -34,9 +35,6 @@ testModule = (mn "Test", [ d (IdeDeclValue (IdeValue (P.Ident "function") P.REmp
d :: IdeDeclaration -> IdeDeclarationAnn
d = IdeDeclarationAnn emptyAnn
-mn :: Text -> P.ModuleName
-mn = P.moduleNameFromString
-
testState :: ModuleMap [IdeDeclarationAnn]
testState = Map.fromList [testModule]
@@ -72,7 +70,7 @@ ef = P.ExternsFile
-- }
moduleMap :: ModuleMap [IdeDeclarationAnn]
-moduleMap = Map.singleton (mn "ClassModule") [d (IdeDeclTypeClass (IdeTypeClass (P.ProperName "MyClass") []))]
+moduleMap = Map.singleton (mn "ClassModule") [ideTypeClass "MyClass" P.kindType []]
ideInstance :: IdeInstance
ideInstance = IdeInstance (mn "InstanceModule") (P.Ident "myClassInstance") mempty mempty
diff --git a/tests/Language/PureScript/Ide/Test.hs b/tests/Language/PureScript/Ide/Test.hs
index 8feb9e2..ba5908f 100644
--- a/tests/Language/PureScript/Ide/Test.hs
+++ b/tests/Language/PureScript/Ide/Test.hs
@@ -49,8 +49,8 @@ ann (IdeDeclarationAnn _ d) a = IdeDeclarationAnn a d
annLoc :: IdeDeclarationAnn -> P.SourceSpan -> IdeDeclarationAnn
annLoc (IdeDeclarationAnn a d) loc = IdeDeclarationAnn a {_annLocation = Just loc} d
-annExp :: IdeDeclarationAnn -> P.ModuleName -> IdeDeclarationAnn
-annExp (IdeDeclarationAnn a d) e = IdeDeclarationAnn a {_annExportedFrom = Just e} d
+annExp :: IdeDeclarationAnn -> Text -> IdeDeclarationAnn
+annExp (IdeDeclarationAnn a d) e = IdeDeclarationAnn a {_annExportedFrom = Just (mn e)} d
annTyp :: IdeDeclarationAnn -> P.Type -> IdeDeclarationAnn
annTyp (IdeDeclarationAnn a d) ta = IdeDeclarationAnn a {_annTypeAnnotation = Just ta} d
@@ -66,11 +66,11 @@ ideValue i ty = ida (IdeDeclValue (IdeValue (P.Ident i) (fromMaybe P.tyString ty
ideType :: Text -> Maybe P.Kind -> IdeDeclarationAnn
ideType pn ki = ida (IdeDeclType (IdeType (P.ProperName pn) (fromMaybe P.kindType ki)))
-ideSynonym :: Text -> P.Type -> IdeDeclarationAnn
-ideSynonym pn ty = ida (IdeDeclTypeSynonym (IdeTypeSynonym (P.ProperName pn) ty))
+ideSynonym :: Text -> P.Type -> P.Kind -> IdeDeclarationAnn
+ideSynonym pn ty kind = ida (IdeDeclTypeSynonym (IdeTypeSynonym (P.ProperName pn) ty kind))
-ideTypeClass :: Text -> [IdeInstance] -> IdeDeclarationAnn
-ideTypeClass pn instances = ida (IdeDeclTypeClass (IdeTypeClass (P.ProperName pn) instances))
+ideTypeClass :: Text -> P.Kind -> [IdeInstance] -> IdeDeclarationAnn
+ideTypeClass pn kind instances = ida (IdeDeclTypeClass (IdeTypeClass (P.ProperName pn) kind instances))
ideDtor :: Text -> Text -> Maybe P.Type -> IdeDeclarationAnn
ideDtor pn tn ty = ida (IdeDeclDataConstructor (IdeDataConstructor (P.ProperName pn) (P.ProperName tn) (fromMaybe P.tyString ty)))
diff --git a/tests/TestPsci.hs b/tests/TestPsci.hs
index cf40aa5..c5017f1 100644
--- a/tests/TestPsci.hs
+++ b/tests/TestPsci.hs
@@ -1,22 +1,15 @@
-{-# LANGUAGE RecordWildCards #-}
-
module TestPsci where
import Prelude ()
import Prelude.Compat
-import Control.Monad (when)
-import System.Exit (exitFailure)
-import Test.HUnit
+import Test.Hspec
import TestPsci.CommandTest (commandTests)
import TestPsci.CompletionTest (completionTests)
+import TestPsci.EvalTest (evalTests)
main :: IO ()
-main = do
- Counts{..} <- runTestTT allTests
- when (errors + failures > 0) exitFailure
-
-allTests :: Test
-allTests = TestList [ completionTests
- , commandTests
- ]
+main = hspec $ do
+ completionTests
+ commandTests
+ evalTests
diff --git a/tests/TestPsci/CommandTest.hs b/tests/TestPsci/CommandTest.hs
index 543a844..f1e36b2 100644
--- a/tests/TestPsci/CommandTest.hs
+++ b/tests/TestPsci/CommandTest.hs
@@ -5,31 +5,30 @@ import Prelude.Compat
import Control.Monad.Trans.RWS.Strict (get)
import Language.PureScript.Interactive
-import Test.HUnit
+import Test.Hspec
import TestPsci.TestEnv
-commandTests :: Test
-commandTests = TestLabel "commandTests" $ TestList $ map (TestCase . execTestPSCi)
- [ do
- run "import Prelude"
- run "import Data.Functor"
- run "import Control.Monad"
- before <- psciImportedModules <$> get
- length before `equalsTo` 3
- run ":clear"
- after <- psciImportedModules <$> get
- length after `equalsTo` 0
- , do
- run "import Prelude"
- run "import Data.Functor"
- run "import Control.Monad"
- before <- psciImportedModules <$> get
- length before `equalsTo` 3
- run ":reload"
- after <- psciImportedModules <$> get
- length after `equalsTo` 3
- , do
- run "import Prelude"
- run "import Data.Array"
- "let fac n = foldl mul 1 (1..n) in fac 10" `evaluatesTo` "3628800"
- ]
+specPSCi :: String -> TestPSCi () -> Spec
+specPSCi label = specify label . execTestPSCi
+
+commandTests :: Spec
+commandTests = context "commandTests" $ do
+ specPSCi ":clear" $ do
+ run "import Prelude"
+ run "import Data.Functor"
+ run "import Control.Monad"
+ ms <- psciImportedModules <$> get
+ length ms `equalsTo` 3
+ run ":clear"
+ ms' <- psciImportedModules <$> get
+ length ms' `equalsTo` 0
+
+ specPSCi ":reload" $ do
+ run "import Prelude"
+ run "import Data.Functor"
+ run "import Control.Monad"
+ ms <- psciImportedModules <$> get
+ length ms `equalsTo` 3
+ run ":reload"
+ ms' <- psciImportedModules <$> get
+ length ms' `equalsTo` 3
diff --git a/tests/TestPsci/CompletionTest.hs b/tests/TestPsci/CompletionTest.hs
index 6ffb486..47f57ca 100644
--- a/tests/TestPsci/CompletionTest.hs
+++ b/tests/TestPsci/CompletionTest.hs
@@ -3,8 +3,9 @@ module TestPsci.CompletionTest where
import Prelude ()
import Prelude.Compat
-import Test.HUnit
+import Test.Hspec
+import Control.Monad (mapM_)
import Control.Monad.Trans.State.Strict (evalStateT)
import Data.List (sort)
import qualified Data.Text as T
@@ -14,10 +15,9 @@ import System.Console.Haskeline
import TestPsci.TestEnv (initTestPSCiEnv)
import TestUtils (supportModules)
-completionTests :: Test
-completionTests =
- TestLabel "completionTests"
- (TestList (map (TestCase . assertCompletedOk) completionTestData))
+completionTests :: Spec
+completionTests = context "completionTests" $
+ mapM_ assertCompletedOk completionTestData
-- If the cursor is at the right end of the line, with the 1st element of the
-- pair as the text in the line, then pressing tab should offer all the
@@ -84,12 +84,12 @@ completionTestData =
, ("Control.Monad.ST.new", ["Control.Monad.ST.newSTRef"])
]
-assertCompletedOk :: (String, [String]) -> Assertion
-assertCompletedOk (line, expecteds) = do
+assertCompletedOk :: (String, [String]) -> Spec
+assertCompletedOk (line, expecteds) = specify line $ do
(unusedR, completions) <- runCM (completion' (reverse line, ""))
let unused = reverse unusedR
let actuals = map ((unused ++) . replacement) completions
- sort expecteds @=? sort actuals
+ sort expecteds `shouldBe` sort actuals
runCM :: CompletionM a -> IO a
runCM act = do
diff --git a/tests/TestPsci/EvalTest.hs b/tests/TestPsci/EvalTest.hs
new file mode 100644
index 0000000..82b566f
--- /dev/null
+++ b/tests/TestPsci/EvalTest.hs
@@ -0,0 +1,66 @@
+module TestPsci.EvalTest where
+
+import Prelude ()
+import Prelude.Compat
+
+import Control.Monad (forM_, foldM_)
+import Control.Monad.IO.Class (liftIO)
+import Data.List (stripPrefix, intercalate)
+import Data.List.Split (splitOn)
+import System.Directory (getCurrentDirectory)
+import System.Exit (exitFailure)
+import System.FilePath ((</>), takeFileName)
+import qualified System.FilePath.Glob as Glob
+import System.IO.UTF8 (readUTF8File)
+import Test.Hspec
+import TestPsci.TestEnv
+
+evalTests :: Spec
+evalTests = context "evalTests" $ do
+ testFiles <- runIO evalTestFiles
+ forM_ testFiles evalTest
+
+evalTestFiles :: IO [FilePath]
+evalTestFiles = do
+ cwd <- getCurrentDirectory
+ let psciExamples = cwd </> "examples" </> "psci"
+ Glob.globDir1 (Glob.compile "**/*.purs") psciExamples
+
+data EvalLine = Line String
+ | Comment EvalContext
+ | Empty
+ | Invalid String
+ deriving (Show)
+
+data EvalContext = ShouldEvaluateTo String
+ | Paste [String]
+ | None
+ deriving (Show)
+
+evalCommentPrefix :: String
+evalCommentPrefix = "-- @"
+
+parseEvalLine :: String -> EvalLine
+parseEvalLine "" = Empty
+parseEvalLine line =
+ case stripPrefix evalCommentPrefix line of
+ Just rest ->
+ case splitOn " " rest of
+ "shouldEvaluateTo" : args -> Comment (ShouldEvaluateTo $ intercalate " " args)
+ "paste" : [] -> Comment (Paste [])
+ _ -> Invalid line
+ Nothing -> Line line
+
+evalTest :: FilePath -> Spec
+evalTest f = specify (takeFileName f) $ do
+ evalLines <- map parseEvalLine . lines <$> readUTF8File f
+ execTestPSCi $ foldM_ handleLine None evalLines
+
+handleLine :: EvalContext -> EvalLine -> TestPSCi EvalContext
+handleLine ctx Empty = pure ctx
+handleLine None (Line stmt) = run stmt >> pure None
+handleLine None (Comment ctx) = pure ctx
+handleLine (ShouldEvaluateTo expected) (Line expr) = expr `evaluatesTo` expected >> pure None
+handleLine (Paste ls) (Line l) = pure . Paste $ ls ++ [l]
+handleLine (Paste ls) (Comment (Paste _)) = run (intercalate "\n" ls) >> pure None
+handleLine _ line = liftIO $ putStrLn ("unexpected: " ++ show line) >> exitFailure
diff --git a/tests/TestPsci/TestEnv.hs b/tests/TestPsci/TestEnv.hs
index 35ae45d..519f8fb 100644
--- a/tests/TestPsci/TestEnv.hs
+++ b/tests/TestPsci/TestEnv.hs
@@ -12,7 +12,7 @@ import System.Exit
import System.FilePath ((</>))
import qualified System.FilePath.Glob as Glob
import System.Process (readProcessWithExitCode)
-import Test.HUnit ((@?=))
+import Test.Hspec (shouldBe)
-- | A monad transformer for handle PSCi actions in tests
type TestPSCi a = RWST PSCiConfig () PSCiState IO a
@@ -70,9 +70,9 @@ runAndEval comm eval =
run :: String -> TestPSCi ()
run comm = runAndEval comm $ jsEval *> return ()
--- | A lifted evaluation of HUnit '@?=' for the TestPSCi
+-- | A lifted evaluation of Hspec 'shouldBe' for the TestPSCi
equalsTo :: (Eq a, Show a) => a -> a -> TestPSCi ()
-equalsTo x y = liftIO $ x @?= y
+equalsTo x y = liftIO $ x `shouldBe` y
-- | An assertion to check if a command evaluates to a string
evaluatesTo :: String -> String -> TestPSCi ()