mirror of
https://github.com/github/semantic.git
synced 2024-12-29 18:06:14 +03:00
fix tests
This commit is contained in:
parent
ab76b1a04d
commit
71e389ef71
@ -88,7 +88,10 @@ pythonPrelude = Just $ File (TypeLevel.symbolVal (Proxy :: Proxy (PreludePath Py
|
||||
javaScriptPrelude = Just $ File (TypeLevel.symbolVal (Proxy :: Proxy (PreludePath TypeScript.Term))) (Just Language.JavaScript)
|
||||
|
||||
-- Evaluate a project, starting at a single entrypoint.
|
||||
evaluateProject parser lang prelude path = evaluatePackageWith id withTermSpans . fmap quieterm <$> runTask (readProject Nothing path lang [] >>= parsePackage parser prelude)
|
||||
evaluateProject parser lang prelude path = do
|
||||
x <- evaluatePackageWith id withTermSpans . fmap quieterm <$> runTask (readProject Nothing path lang [] >>= parsePackage parser prelude)
|
||||
pure (TermEvaluator (runAllocator (runTermEvaluator x >>= mapM deref)))
|
||||
|
||||
evaluateProjectWithCaching parser lang prelude path = evaluatePackageWith convergingModules (withTermSpans . cachingTerms) . fmap quieterm <$> runTask (readProject Nothing path lang [] >>= parsePackage parser prelude)
|
||||
|
||||
|
||||
|
@ -19,13 +19,13 @@ import SpecHelpers hiding (reassociate)
|
||||
spec :: Spec
|
||||
spec = parallel $ do
|
||||
it "constructs integers" $ do
|
||||
(expected, _) <- evaluate (integer 123)
|
||||
(expected, _) <- evaluate (box =<< integer 123)
|
||||
expected `shouldBe` Right (injValue (Value.Integer (Number.Integer 123)))
|
||||
|
||||
it "calls functions" $ do
|
||||
(expected, _) <- evaluate $ do
|
||||
identity <- closure [name "x"] lowerBound (variable (name "x"))
|
||||
call identity [integer 123]
|
||||
call identity [box =<< integer 123]
|
||||
expected `shouldBe` Right (injValue (Value.Integer (Number.Integer 123)))
|
||||
|
||||
evaluate
|
||||
@ -38,6 +38,7 @@ evaluate
|
||||
. runEnvironmentError
|
||||
. runAddressError
|
||||
. runAllocator
|
||||
. (>>= deref)
|
||||
. runReturn
|
||||
. runLoopControl
|
||||
. fmap fst
|
||||
|
Loading…
Reference in New Issue
Block a user