1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Update tests for new AccessControl / Relation split

This commit is contained in:
Rick Winfrey 2019-01-16 18:20:33 -08:00
parent 12e63cac6d
commit bf3ff6154a
3 changed files with 5 additions and 5 deletions

View File

@ -35,11 +35,11 @@ spec = parallel $ do
let lexicalEdges = Map.singleton Lexical [ currentScope' ]
x = SpecHelpers.name "x"
associatedScope <- newScope lexicalEdges
declare (ScopeGraph.Declaration "identity") (Default Public) emptySpan (Just associatedScope)
declare (ScopeGraph.Declaration "identity") Default Public emptySpan (Just associatedScope)
withScope associatedScope $ do
declare (Declaration x) (Default Public) emptySpan Nothing
declare (Declaration x) Default Public emptySpan Nothing
identity <- function "identity" [ x ]
(SpecEff (Heap.lookupDeclaration (ScopeGraph.Declaration (SpecHelpers.name "x")) >>= deref)) associatedScope
(SpecEff (Heap.lookupSlot (ScopeGraph.Declaration (SpecHelpers.name "x")) >>= deref)) associatedScope
val <- pure (integer 123)
call identity [val]
expected `shouldBe` Right (integer 123)

View File

@ -235,7 +235,7 @@ instance Listable1 Declaration.Function where
instance Listable1 Declaration.Method where
liftTiers tiers = liftCons6 (liftTiers tiers) tiers tiers tiers (liftTiers tiers) tiers Declaration.Method
instance Listable1 Declaration.Visibility where
instance Listable1 Declaration.AccessControl where
liftTiers tiers = cons0 Declaration.Unknown \/ cons0 Declaration.Public \/ cons0 Declaration.Protected \/ cons0 Declaration.Private
instance Listable1 Statement.If where

View File

@ -188,7 +188,7 @@ lookupDeclaration :: Name -> (Precise, Precise) -> Heap Precise Precise (Value t
lookupDeclaration name (currentScope, currentFrame) heap scopeGraph = do
path <- ScopeGraph.lookupScopePath name currentScope scopeGraph
frameAddress <- Heap.lookupFrameAddress path currentFrame heap
toList <$> Heap.getSlot (Slot frameAddress (Heap.pathPosition path)) heap
toList <$> Heap.getSlotValue (Slot frameAddress (Heap.pathPosition path)) heap
newtype Verbatim = Verbatim ByteString
deriving (Eq)