mirror of
https://github.com/github/semantic.git
synced 2024-12-29 01:42:43 +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
|
||||
|
||||
import Data.Abstract.Environment as Env
|
||||
import Data.Abstract.Evaluatable (EvalError(..))
|
||||
import qualified Data.Abstract.ModuleTable as ModuleTable
|
||||
import Data.Abstract.Value.Concrete
|
||||
@ -20,9 +19,8 @@ spec config = parallel $ do
|
||||
const () <$> SpecHelpers.lookupDeclaration "a" heap scopeGraph `shouldBe` Just ()
|
||||
const () <$> SpecHelpers.lookupDeclaration "b" heap scopeGraph `shouldBe` Just ()
|
||||
|
||||
-- (lookupDeclaration "a" heap >>= deNamespace heap) `shouldBe` Just ("a", ["foo"])
|
||||
-- (lookupDeclaration "b" heap >>= deNamespace heap) `shouldBe` Just ("b", ["c"])
|
||||
undefined
|
||||
(SpecHelpers.lookupDeclaration "a" heap scopeGraph >>= objectMembers heap scopeGraph . head) `shouldBe` Just ["foo"]
|
||||
(SpecHelpers.lookupDeclaration "b" heap scopeGraph >>= objectMembers heap scopeGraph . head) `shouldBe` Just ["c"]
|
||||
-- (derefQName heap ("b" :| ["c"]) env >>= deNamespace heap) `shouldBe` Just ("c", ["baz"])
|
||||
other -> expectationFailure (show other)
|
||||
|
||||
|
@ -34,13 +34,7 @@ spec = parallel $ do
|
||||
(_, (_, expected)) <- evaluate $ do
|
||||
withLexicalScopeAndFrame $ do
|
||||
declare (ScopeGraph.Declaration "identity") emptySpan Nothing
|
||||
valueRef <- function "identity" [ SpecEff (do
|
||||
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"))
|
||||
]
|
||||
valueRef <- function "identity" [ SpecHelpers.name "x", SpecHelpers.name "y" ]
|
||||
(SpecEff (LvalMember <$> Heap.lookupDeclaration (ScopeGraph.Declaration (SpecHelpers.name "y"))))
|
||||
identity <- value valueRef
|
||||
val <- pure (integer 123)
|
||||
|
Loading…
Reference in New Issue
Block a user