From 2c8bb243431bf2424163f3636ce2e86eaa5791ef Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 30 May 2017 10:33:59 -0400 Subject: [PATCH] Test that diffAndRenderTermPair produces Nothing when both blobs are missing. --- test/SemanticSpec.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/SemanticSpec.hs b/test/SemanticSpec.hs index 2a3fd40b4..ef7a8e57a 100644 --- a/test/SemanticSpec.hs +++ b/test/SemanticSpec.hs @@ -27,5 +27,10 @@ spec = parallel $ do output <- runTask $ parseAndRenderBlob SExpressionTermRenderer methodsBlob output `shouldBe` "(Program\n (Method\n (Identifier)))\n" + describe "diffAndRenderTermPair" $ do + it "produces Nothing when both blobs are missing" $ do + result <- runTask (diffAndRenderTermPair (pure (emptySourceBlob "/foo")) (runBothWith replacing) (const "non-empty") (pure (cofree (() :< [])))) + result `shouldBe` Nothing + where methodsBlob = SourceBlob (Source "def foo\nend\n") "ff7bbbe9495f61d9e1e58c597502d152bab1761e" "methods.rb" (Just defaultPlainBlob) (Just Ruby)