Package: yi / 0.7.1-5

Yi.Syntax.Tree-quickcheck-2.7-patch.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Index: yi-0.7.1/src/library/Yi/Syntax/Tree.hs
===================================================================
--- yi-0.7.1.orig/src/library/Yi/Syntax/Tree.hs	2014-08-04 11:25:59.621939411 +0200
+++ yi-0.7.1/src/library/Yi/Syntax/Tree.hs	2014-08-04 11:25:59.621939411 +0200
@@ -25,6 +25,7 @@
 import Data.Monoid (First(..), Last(..), getFirst, getLast, mempty)
 #ifdef TESTING
 import Test.QuickCheck
+import Test.QuickCheck.Property (unProperty)
 #endif
 
 import Yi.Buffer.Basic
@@ -339,33 +340,35 @@
    let final@(_, (_, finalSubtree)) = fromLeafAfterToFinal p n
        finalRegion = subtreeRegion finalSubtree
        initialRegion = nodeRegion n
-       
+
    whenFail (do putStrLn $ "final = " ++ show final
                 putStrLn $ "final reg = " ++ show finalRegion
                 putStrLn $ "initialReg = " ++ show initialRegion
                 putStrLn $ "p = " ++ show p
-            ) 
+            )
      ((regionStart finalRegion <= p) && (initialRegion `includedRegion` finalRegion))
 
 prop_allLeavesAfter :: NTTT -> Property
-prop_allLeavesAfter (N n@(xs,t)) = do
+prop_allLeavesAfter (N n@(xs,t)) = property $ do
   let after = allLeavesRelative afterChild n
   (xs',t') <- elements after
   let t'' = walkDown (xs',t)
-  whenFail (do putStrLn $ "t' = " ++ show t'
-               putStrLn $ "t'' = " ++ show t''
-               putStrLn $ "xs' = " ++ show xs'
-           ) (Just t' == t'' && xs <= xs')
+  unProperty $ whenFail (do
+      putStrLn $ "t' = " ++ show t'
+      putStrLn $ "t'' = " ++ show t''
+      putStrLn $ "xs' = " ++ show xs'
+    ) (Just t' == t'' && xs <= xs')
 
 prop_allLeavesBefore :: NTTT -> Property
-prop_allLeavesBefore (N n@(xs,t)) = do
+prop_allLeavesBefore (N n@(xs,t)) = property $ do
   let after = allLeavesRelative beforeChild n
   (xs',t') <- elements after
   let t'' = walkDown (xs',t)
-  whenFail (do putStrLn $ "t' = " ++ show t'
-               putStrLn $ "t'' = " ++ show t''
-               putStrLn $ "xs' = " ++ show xs'
-           ) (Just t' == t'' && xs' <= xs)
+  unProperty $ whenFail (do
+      putStrLn $ "t' = " ++ show t'
+      putStrLn $ "t'' = " ++ show t''
+      putStrLn $ "xs' = " ++ show xs'
+    ) (Just t' == t'' && xs' <= xs)
 
 prop_fromNodeToLeafAfter :: NTTT -> Property
 prop_fromNodeToLeafAfter (N n) = forAll (pointInside (subtreeRegion $ snd n)) $ \p -> do