summaryrefslogtreecommitdiff
path: root/examples/testdiff.hs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/testdiff.hs')
-rw-r--r--examples/testdiff.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/testdiff.hs b/examples/testdiff.hs
index 9360545..2847fc3 100644
--- a/examples/testdiff.hs
+++ b/examples/testdiff.hs
@@ -10,7 +10,7 @@ source = "It could be said that Joe was here. I don't know what to do about it."
10patched :: L.ByteString 10patched :: L.ByteString
11patched = "It could be said that Joe, the magnificent, was here. I don't know what to do about it." 11patched = "It could be said that Joe, the magnificent, was here. I don't know what to do about it."
12 12
13delta :: XDeltaFailable XDelta 13delta :: Result VCDIFF
14delta = computeDiff defaultConfig source patched 14delta = computeDiff defaultConfig source patched
15 15
16main = do 16main = do
@@ -19,11 +19,13 @@ main = do
19 mapM_ putStrLn $ xxd2 0 (L.toStrict patched) 19 mapM_ putStrLn $ xxd2 0 (L.toStrict patched)
20 putStrLn "" 20 putStrLn ""
21 case delta of 21 case delta of
22 XResult δ@(XDelta d) me -> do 22 Result δ@(VCDIFF d) me -> do
23 -- mapM_ (mapM_ putStrLn . xxd2 0) (chunksOf 16 d) 23 -- mapM_ (mapM_ putStrLn . xxd2 0) (chunksOf 16 d)
24 mapM_ putStrLn $ xxd2 0 (L.toStrict d) 24 mapM_ putStrLn $ xxd2 0 (L.toStrict d)
25 print me 25 print me
26 putStrLn "" 26 putStrLn ""
27 let XResult patched' pe = applyPatch defaultConfig source δ 27 let Result patched' pe = applyPatch defaultConfig source δ
28 mapM_ putStrLn $ xxd2 0 (L.toStrict patched') -- $ L.take 48 patched') 28 mapM_ putStrLn $ xxd2 0 (L.toStrict patched') -- $ L.take 48 patched')
29 print pe 29 print pe
30 print ("source",source)
31 print ("patched",patched)