cleanup
This commit is contained in:
parent
32a0e6359c
commit
4d99921bde
@ -38,9 +38,9 @@ data DiffStatus
|
||||
|
||||
|
||||
data DiffPlainStatus
|
||||
= PlainUnchanged
|
||||
| PlainInserted
|
||||
| PlainDeleted
|
||||
= UnchangedP
|
||||
| InsertedP
|
||||
| DeletedP
|
||||
deriving (Show, Eq)
|
||||
|
||||
|
||||
@ -65,8 +65,8 @@ data FormattedChar = FormattedChar
|
||||
deriving (Show, Eq)
|
||||
|
||||
|
||||
newtype LeftSide a = LeftSide a
|
||||
newtype RightSide a = RightSide a
|
||||
newtype LeftSide a = LeftSide a deriving (Show, Eq)
|
||||
newtype RightSide a = RightSide a deriving (Show, Eq)
|
||||
|
||||
|
||||
newtype DeleteIndicies = DeleteIndicies (Seq Int) deriving (Show, Eq)
|
||||
@ -102,9 +102,9 @@ findPlainDiffs (LeftSide left) (RightSide right) = f <$> diffs
|
||||
f :: DiffedChar -> DiffedPlainChar
|
||||
f (DiffedChar (FormattedChar c _) diffStatus) = DiffedPlainChar c diffStatusPlain
|
||||
where diffStatusPlain = case diffStatus of
|
||||
UnchangedChar _ -> PlainUnchanged
|
||||
Inserted -> PlainInserted
|
||||
Deleted -> PlainDeleted
|
||||
UnchangedChar _ -> UnchangedP
|
||||
Inserted -> InsertedP
|
||||
Deleted -> DeletedP
|
||||
|
||||
|
||||
findDiffs :: LeftSide (Seq FormattedChar) -> RightSide (Seq FormattedChar) -> Seq DiffedChar
|
||||
|
@ -307,18 +307,18 @@ formattedEditedTextTests = describe "show edits" do
|
||||
it "findPlainDiffs" do
|
||||
findPlainDiffs (LeftSide "Hrl~!@lo") (RightSide "Herxy!@zo12")
|
||||
`shouldBe` S.fromList
|
||||
[ DiffedPlainChar 'H' PlainUnchanged
|
||||
, DiffedPlainChar 'e' PlainInserted
|
||||
, DiffedPlainChar 'r' PlainUnchanged
|
||||
, DiffedPlainChar 'l' PlainDeleted
|
||||
, DiffedPlainChar '~' PlainDeleted
|
||||
, DiffedPlainChar 'x' PlainInserted
|
||||
, DiffedPlainChar 'y' PlainInserted
|
||||
, DiffedPlainChar '!' PlainUnchanged
|
||||
, DiffedPlainChar '@' PlainUnchanged
|
||||
, DiffedPlainChar 'l' PlainDeleted
|
||||
, DiffedPlainChar 'z' PlainInserted
|
||||
, DiffedPlainChar 'o' PlainUnchanged
|
||||
, DiffedPlainChar '1' PlainInserted
|
||||
, DiffedPlainChar '2' PlainInserted
|
||||
[ DiffedPlainChar 'H' UnchangedP
|
||||
, DiffedPlainChar 'e' InsertedP
|
||||
, DiffedPlainChar 'r' UnchangedP
|
||||
, DiffedPlainChar 'l' DeletedP
|
||||
, DiffedPlainChar '~' DeletedP
|
||||
, DiffedPlainChar 'x' InsertedP
|
||||
, DiffedPlainChar 'y' InsertedP
|
||||
, DiffedPlainChar '!' UnchangedP
|
||||
, DiffedPlainChar '@' UnchangedP
|
||||
, DiffedPlainChar 'l' DeletedP
|
||||
, DiffedPlainChar 'z' InsertedP
|
||||
, DiffedPlainChar 'o' UnchangedP
|
||||
, DiffedPlainChar '1' InsertedP
|
||||
, DiffedPlainChar '2' InsertedP
|
||||
]
|
Loading…
Reference in New Issue
Block a user