2015-12-18 17:49:21 +03:00
|
|
|
module PatchOutputSpec where
|
|
|
|
|
2016-02-29 05:10:56 +03:00
|
|
|
import Data.Bifunctor.Join
|
2015-12-18 17:49:33 +03:00
|
|
|
import Diff
|
2016-02-25 23:20:25 +03:00
|
|
|
import Renderer.Patch
|
2015-12-18 17:49:33 +03:00
|
|
|
import Range
|
2015-12-25 00:38:50 +03:00
|
|
|
import Source
|
2015-12-18 17:49:33 +03:00
|
|
|
import Syntax
|
|
|
|
import Control.Monad.Free
|
2015-12-18 17:49:21 +03:00
|
|
|
import Test.Hspec
|
|
|
|
|
|
|
|
spec :: Spec
|
2016-02-10 22:32:26 +03:00
|
|
|
spec = parallel $
|
|
|
|
describe "hunks" $
|
2015-12-18 17:49:33 +03:00
|
|
|
it "empty diffs have no hunks" $
|
2016-02-29 05:10:56 +03:00
|
|
|
hunks (Free . Annotated (Info (Range 0 0) mempty, Info (Range 0 0) mempty) $ Leaf "") (Join (SourceBlob (fromList "") "abcde" "path2.txt", SourceBlob (fromList "") "xyz" "path2.txt")) `shouldBe` []
|