1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 18:23:44 +03:00
semantic/test/PatchOutputSpec.hs

18 lines
626 B
Haskell
Raw Normal View History

2015-12-18 17:49:21 +03:00
module PatchOutputSpec where
2017-06-24 17:09:50 +03:00
import Data.Blob
2017-09-27 19:41:41 +03:00
import Data.Diff
import Data.Functor.Both
2017-06-24 16:46:28 +03:00
import Data.Range
import Data.Record
2016-03-31 00:33:07 +03:00
import Renderer.Patch
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" $
2017-09-12 17:49:45 +03:00
hunks (merge (Range 0 0 :. Nil, Range 0 0 :. Nil) (Leaf "")) (both (Blob mempty "abcde" "path2.txt" (Just defaultPlainBlob) Nothing) (Blob mempty "xyz" "path2.txt" (Just defaultPlainBlob) Nothing)) `shouldBe` [Hunk {offset = pure 0, changes = [], trailingContext = []}]