diff --git a/test/Analysis/Python/Spec.hs b/test/Analysis/Python/Spec.hs index 80c30a335..7a46bd89e 100644 --- a/test/Analysis/Python/Spec.hs +++ b/test/Analysis/Python/Spec.hs @@ -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) diff --git a/test/Control/Abstract/Evaluator/Spec.hs b/test/Control/Abstract/Evaluator/Spec.hs index adfb37f66..f08f5ffe9 100644 --- a/test/Control/Abstract/Evaluator/Spec.hs +++ b/test/Control/Abstract/Evaluator/Spec.hs @@ -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)