1
1
mirror of https://github.com/github/semantic.git synced 2024-12-28 09:21:35 +03:00

Add invalid prefix with valid integer value test

This commit is contained in:
Rick Winfrey 2017-03-21 10:35:22 -07:00
parent 3e9d7f26bb
commit 773e808bdb

View File

@ -109,6 +109,20 @@ spec = parallel $ do
liftIO $ shouldBe (either (const $ Just 1) repoID updateData) Nothing
liftIO $ shouldBe (either (const $ Just 1) userID updateData) Nothing
-- | Verifying invalid prefix and valid ID returns Nothing.
liftIO $ setEnv "GIT_SOCKSTAT_VAR_repo_id" "10"
liftIO $ setEnv "GIT_SOCKSTAT_VAR_user_id" "20"
liftIO $ sendAll server "continue"
_ <- reportGitmon' socketFactory "cat-file" $ lookupCommit object
info <- liftIO $ recv server 1024
let [updateData, _, _] = infoToData info
liftIO $ shouldBe (either (const $ Just 1) repoID updateData) Nothing
liftIO $ shouldBe (either (const $ Just 1) userID updateData) Nothing
it "returns the correct git result if the socket is unavailable" . withSocketPair $ \(client, server, socketFactory) ->
withRepository lgFactory wd $ do
liftIO $ close client