1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 18:36:27 +03:00
semantic/test/PatchOutputSpec.hs

18 lines
640 B
Haskell
Raw Normal View History

2015-12-18 17:49:21 +03:00
module PatchOutputSpec where
2016-05-26 20:11:34 +03:00
import Prologue
import Data.Functor.Both
import Data.Record
2015-12-18 17:49:33 +03:00
import Range
2016-03-31 00:33:07 +03:00
import Renderer.Patch
2015-12-25 00:38:50 +03:00
import Source
2015-12-18 17:49:33 +03:00
import Syntax
import Test.Hspec (Spec, describe, it, parallel)
import Test.Hspec.Expectations.Pretty
2015-12-18 17:49:21 +03:00
spec :: Spec
spec = parallel $ do
describe "hunks" $ do
2016-03-02 01:13:53 +03:00
it "empty diffs have empty hunks" $
hunks (wrap $ pure (Range 0 0 :. Nil) :< Leaf ("" :: Text)) (both (SourceBlob Source.empty "abcde" "path2.txt" (Just defaultPlainBlob) Nothing) (SourceBlob Source.empty "xyz" "path2.txt" (Just defaultPlainBlob) Nothing)) `shouldBe` [Hunk {offset = pure 0, changes = [], trailingContext = []}]