mirror of
https://github.com/github/semantic.git
synced 2024-11-25 02:58:36 +03:00
de6d7edec2
# Conflicts: # semantic-diff.cabal # src/Alignment.hs # src/Control/Comonad/Cofree.hs # src/Data/Adjoined.hs # src/Diffing.hs # src/Interpreter.hs # src/Prologue.hs # src/Renderer/JSON.hs # src/Renderer/Patch.hs # src/Renderer/Split.hs # src/SplitDiff.hs # src/Term.hs # test/AlignmentSpec.hs # test/ArbitraryTerm.hs # test/PatchOutputSpec.hs
19 lines
581 B
Haskell
19 lines
581 B
Haskell
module PatchOutputSpec where
|
|
|
|
import Prologue
|
|
import Data.Functor.Both
|
|
import Data.String
|
|
import Diff
|
|
import Info
|
|
import Range
|
|
import Renderer.Patch
|
|
import Source
|
|
import Syntax
|
|
import Test.Hspec
|
|
|
|
spec :: Spec
|
|
spec = parallel $
|
|
describe "hunks" $
|
|
it "empty diffs have empty hunks" $
|
|
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 = []}]
|