1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00

Merge branch 'indexer-prototype' of https://github.com/github/semantic into indexer-prototype

This commit is contained in:
joshvera 2019-01-18 16:42:38 -05:00
commit 52afa47ca3
2 changed files with 4 additions and 6 deletions

View File

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

View File

@ -19,11 +19,9 @@ spec :: Spec
spec =
describe "RepositoryPush protobuf serialization" $
it "should round-trip correctly" $ do
(Right decoded) <- fromByteString @Envelope sampleEnvelope
let (Right decoded) = fromByteString @Envelope sampleEnvelope
envelopeId decoded `shouldBe` "f1ef901a-ca31-4d6b-aff1-a5ea1e2a940e"
(Right message) <- fromByteString @RepositoryPush (envelopeMessage decoded)
let (Right message) = fromByteString @RepositoryPush (envelopeMessage decoded)
let (Present mona) = pushActor message
userLogin mona `shouldBe` "monalisa"
toByteString decoded `shouldBe` sampleEnvelope