From 25b89ada334994b9827cad4056e15fa38fe4e746 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 30 May 2017 10:25:22 -0400 Subject: [PATCH] Update CommandSpec & SpecHelpers for Maybe returns. --- test/CommandSpec.hs | 2 +- test/SpecHelpers.hs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/CommandSpec.hs b/test/CommandSpec.hs index ad81340d6..743363619 100644 --- a/test/CommandSpec.hs +++ b/test/CommandSpec.hs @@ -143,7 +143,7 @@ data Fixture = Fixture { shas :: Both String, expectedBlobs :: [Both SourceBlob] fetchDiffsOutput :: (Object -> Text) -> FilePath -> String -> String -> [(FilePath, Maybe Language)] -> IO Summaries fetchDiffsOutput f gitDir sha1 sha2 filePaths = do blobPairs <- runCommand $ readFilesAtSHAs gitDir [] filePaths (both sha1 sha2) - runTask $ distributeFoldMap (Semantic.parseDiffAndRenderBlobPair Renderer.ToCDiffRenderer) blobPairs + fromMaybe mempty <$> runTask (distributeFoldMap (Semantic.parseDiffAndRenderBlobPair Renderer.ToCDiffRenderer) blobPairs) -- Diff Summaries payloads look like this: -- { diff --git a/test/SpecHelpers.hs b/test/SpecHelpers.hs index 236e04899..81e94fdd1 100644 --- a/test/SpecHelpers.hs +++ b/test/SpecHelpers.hs @@ -27,13 +27,13 @@ import Term diffFilePaths :: Both FilePath -> IO ByteString diffFilePaths paths = do blobs <- traverse readFile paths - runTask $ parseDiffAndRenderBlobPair SExpressionDiffRenderer blobs + fromMaybe mempty <$> runTask (parseDiffAndRenderBlobPair SExpressionDiffRenderer blobs) -- | Returns an s-expression parse tree for the specified FilePath. parseFilePath :: FilePath -> IO ByteString parseFilePath path = do blob <- readFile path - runTask $ parseAndRenderBlob SExpressionTermRenderer blob + runTask (parseAndRenderBlob SExpressionTermRenderer blob) -- | Read a file to a SourceBlob. --