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:
parent
3e9d7f26bb
commit
773e808bdb
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user