mirror of
https://github.com/github/semantic.git
synced 2024-12-29 18:06:14 +03:00
Fix up python test and function args
This commit is contained in:
parent
57015e94cc
commit
2b11d7aa2a
@ -1,6 +1,5 @@
|
|||||||
module Analysis.Python.Spec (spec) where
|
module Analysis.Python.Spec (spec) where
|
||||||
|
|
||||||
import Data.Abstract.Environment as Env
|
|
||||||
import Data.Abstract.Evaluatable (EvalError(..))
|
import Data.Abstract.Evaluatable (EvalError(..))
|
||||||
import qualified Data.Abstract.ModuleTable as ModuleTable
|
import qualified Data.Abstract.ModuleTable as ModuleTable
|
||||||
import Data.Abstract.Value.Concrete
|
import Data.Abstract.Value.Concrete
|
||||||
@ -20,9 +19,8 @@ spec config = parallel $ do
|
|||||||
const () <$> SpecHelpers.lookupDeclaration "a" heap scopeGraph `shouldBe` Just ()
|
const () <$> SpecHelpers.lookupDeclaration "a" heap scopeGraph `shouldBe` Just ()
|
||||||
const () <$> SpecHelpers.lookupDeclaration "b" heap scopeGraph `shouldBe` Just ()
|
const () <$> SpecHelpers.lookupDeclaration "b" heap scopeGraph `shouldBe` Just ()
|
||||||
|
|
||||||
-- (lookupDeclaration "a" heap >>= deNamespace heap) `shouldBe` Just ("a", ["foo"])
|
(SpecHelpers.lookupDeclaration "a" heap scopeGraph >>= objectMembers heap scopeGraph . head) `shouldBe` Just ["foo"]
|
||||||
-- (lookupDeclaration "b" heap >>= deNamespace heap) `shouldBe` Just ("b", ["c"])
|
(SpecHelpers.lookupDeclaration "b" heap scopeGraph >>= objectMembers heap scopeGraph . head) `shouldBe` Just ["c"]
|
||||||
undefined
|
|
||||||
-- (derefQName heap ("b" :| ["c"]) env >>= deNamespace heap) `shouldBe` Just ("c", ["baz"])
|
-- (derefQName heap ("b" :| ["c"]) env >>= deNamespace heap) `shouldBe` Just ("c", ["baz"])
|
||||||
other -> expectationFailure (show other)
|
other -> expectationFailure (show other)
|
||||||
|
|
||||||
|
@ -34,13 +34,7 @@ spec = parallel $ do
|
|||||||
(_, (_, expected)) <- evaluate $ do
|
(_, (_, expected)) <- evaluate $ do
|
||||||
withLexicalScopeAndFrame $ do
|
withLexicalScopeAndFrame $ do
|
||||||
declare (ScopeGraph.Declaration "identity") emptySpan Nothing
|
declare (ScopeGraph.Declaration "identity") emptySpan Nothing
|
||||||
valueRef <- function "identity" [ SpecEff (do
|
valueRef <- function "identity" [ SpecHelpers.name "x", SpecHelpers.name "y" ]
|
||||||
declare (ScopeGraph.Declaration "x") emptySpan Nothing
|
|
||||||
pure $ Rval (Value.Symbol $ pack "x"))
|
|
||||||
, SpecEff (do
|
|
||||||
declare (ScopeGraph.Declaration "y") emptySpan Nothing
|
|
||||||
pure $ Rval (Value.Symbol $ pack "y"))
|
|
||||||
]
|
|
||||||
(SpecEff (LvalMember <$> Heap.lookupDeclaration (ScopeGraph.Declaration (SpecHelpers.name "y"))))
|
(SpecEff (LvalMember <$> Heap.lookupDeclaration (ScopeGraph.Declaration (SpecHelpers.name "y"))))
|
||||||
identity <- value valueRef
|
identity <- value valueRef
|
||||||
val <- pure (integer 123)
|
val <- pure (integer 123)
|
||||||
|
Loading…
Reference in New Issue
Block a user