2015-12-18 17:49:21 +03:00
|
|
|
module PatchOutputSpec where
|
|
|
|
|
2016-05-26 20:11:34 +03:00
|
|
|
import Prologue
|
2016-02-29 05:29:59 +03:00
|
|
|
import Data.Functor.Both
|
2016-05-26 22:25:45 +03:00
|
|
|
import Data.String
|
2015-12-18 17:49:33 +03:00
|
|
|
import Diff
|
2016-03-31 00:33:07 +03:00
|
|
|
import Info
|
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
|
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" $
|
2016-03-02 01:13:53 +03:00
|
|
|
it "empty diffs have empty hunks" $
|
2016-05-27 16:35:26 +03:00
|
|
|
hunks (free . Free $ pure (Info (Range 0 0) mempty 1) :< Leaf "") (both (SourceBlob (fromList "") "abcde" "path2.txt" (Just defaultPlainBlob)) (SourceBlob (fromList "") "xyz" "path2.txt" (Just defaultPlainBlob))) `shouldBe` [Hunk {offset = pure 0, changes = [], trailingContext = []}]
|