1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 14:54:16 +03:00
semantic/test/PatchOutputSpec.hs

17 lines
566 B
Haskell
Raw Normal View History

2015-12-18 17:49:21 +03:00
module PatchOutputSpec where
import Data.Functor.Both
2015-12-18 17:49:33 +03:00
import Diff
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" $
2016-03-02 01:13:53 +03:00
it "empty diffs have empty hunks" $
2016-03-09 00:04:44 +03:00
hunks (Free . Annotated (pure (Info (Range 0 0) mempty)) $ Leaf "") (Both (SourceBlob (fromList "") "abcde" "path2.txt" (Just defaultPlainBlob), SourceBlob (fromList "") "xyz" "path2.txt" (Just defaultPlainBlob))) `shouldBe` [Hunk {offset = Both (0, 0), changes = [], trailingContext = []}]