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
|
2017-06-24 16:46:28 +03:00
|
|
|
import Data.Range
|
2016-06-17 20:33:50 +03:00
|
|
|
import Data.Record
|
2017-06-24 16:59:41 +03:00
|
|
|
import Data.Source as Source
|
2016-03-31 00:33:07 +03:00
|
|
|
import Renderer.Patch
|
2015-12-18 17:49:33 +03:00
|
|
|
import Syntax
|
2016-09-15 00:45:23 +03:00
|
|
|
import Test.Hspec (Spec, describe, it, parallel)
|
|
|
|
import Test.Hspec.Expectations.Pretty
|
2015-12-18 17:49:21 +03:00
|
|
|
|
|
|
|
spec :: Spec
|
2016-07-22 00:21:13 +03:00
|
|
|
spec = parallel $ do
|
|
|
|
describe "hunks" $ do
|
2016-03-02 01:13:53 +03:00
|
|
|
it "empty diffs have empty hunks" $
|
2017-05-10 01:49:38 +03:00
|
|
|
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 = []}]
|