Skip to content
This repository
Browse code

Make test-suite -Wall clean as well

  • Loading branch information...
commit 92f19c07a682dcf644172f83b6c2a85971951ed1 1 parent a29b6d3
Johan Tibell tibbe authored
1  Cabal/Cabal.cabal
@@ -138,6 +138,7 @@ test-suite unit-tests
138 138 HUnit,
139 139 QuickCheck,
140 140 Cabal
  141 + ghc-options: -Wall
141 142 Default-Language: Haskell98
142 143
143 144 -- Large, system tests that build packages.
20 Cabal/tests/UnitTests/Distribution/Compat/ReadP.hs
@@ -20,11 +20,10 @@ module UnitTests.Distribution.Compat.ReadP
20 20
21 21 import Data.List
22 22 import Distribution.Compat.ReadP
23   -
24 23 import Test.Framework
25   -import Test.Framework.Providers.HUnit
26 24 import Test.Framework.Providers.QuickCheck2
27 25
  26 +tests :: [Test]
28 27 tests =
29 28 [ testProperty "Get Nil" prop_Get_Nil
30 29 , testProperty "Get Cons" prop_Get_Cons
@@ -69,21 +68,27 @@ xs =~ ys = sort xs == sort ys
69 68
70 69 -- Here follow the properties:
71 70
  71 +prop_Get_Nil :: Bool
72 72 prop_Get_Nil =
73 73 readP_to_S get [] =~ []
74 74
  75 +prop_Get_Cons :: Char -> [Char] -> Bool
75 76 prop_Get_Cons c s =
76 77 readP_to_S get (c:s) =~ [(c,s)]
77 78
  79 +prop_Look :: String -> Bool
78 80 prop_Look s =
79 81 readP_to_S look s =~ [(s,s)]
80 82
  83 +prop_Fail :: String -> Bool
81 84 prop_Fail s =
82 85 readP_to_S pfail s =~. []
83 86
  87 +prop_Return :: Int -> String -> Bool
84 88 prop_Return x s =
85 89 readP_to_S (return x) s =~. [(x,s)]
86 90
  91 +{-
87 92 prop_Bind p k s =
88 93 readP_to_S (p >>= k) s =~.
89 94 [ ys''
@@ -91,10 +96,12 @@ prop_Bind p k s =
91 96 , ys'' <- readP_to_S (k (x::Int)) s'
92 97 ]
93 98
  99 +prop_Plus :: ReadP Int Int -> ReadP Int Int -> String -> Bool
94 100 prop_Plus p q s =
95 101 readP_to_S (p +++ q) s =~.
96 102 (readP_to_S p s ++ readP_to_S q s)
97 103
  104 +prop_LeftPlus :: ReadP Int Int -> ReadP Int Int -> String -> Bool
98 105 prop_LeftPlus p q s =
99 106 readP_to_S (p <++ q) s =~.
100 107 (readP_to_S p s +<+ readP_to_S q s)
@@ -102,7 +109,6 @@ prop_LeftPlus p q s =
102 109 [] +<+ ys = ys
103 110 xs +<+ _ = xs
104 111
105   -{-
106 112 prop_Gather s =
107 113 forAll readPWithoutReadS $ \p ->
108 114 readP_to_S (gather p) s =~
@@ -112,28 +118,36 @@ prop_Gather s =
112 118 ]
113 119 -}
114 120
  121 +prop_String_Yes :: String -> [Char] -> Bool
115 122 prop_String_Yes this s =
116 123 readP_to_S (string this) (this ++ s) =~
117 124 [(this,s)]
118 125
  126 +prop_String_Maybe :: String -> String -> Bool
119 127 prop_String_Maybe this s =
120 128 readP_to_S (string this) s =~
121 129 [(this, drop (length this) s) | this `isPrefixOf` s]
122 130
  131 +prop_Munch :: (Char -> Bool) -> String -> Bool
123 132 prop_Munch p s =
124 133 readP_to_S (munch p) s =~
125 134 [(takeWhile p s, dropWhile p s)]
126 135
  136 +prop_Munch1 :: (Char -> Bool) -> String -> Bool
127 137 prop_Munch1 p s =
128 138 readP_to_S (munch1 p) s =~
129 139 [(res,s') | let (res,s') = (takeWhile p s, dropWhile p s), not (null res)]
130 140
  141 +{-
  142 +prop_Choice :: [ReadP Int Int] -> String -> Bool
131 143 prop_Choice ps s =
132 144 readP_to_S (choice ps) s =~.
133 145 readP_to_S (foldr (+++) pfail ps) s
134 146
  147 +prop_ReadS :: ReadS Int -> String -> Bool
135 148 prop_ReadS r s =
136 149 readP_to_S (readS_to_P r) s =~. r s
  150 +-}
137 151
138 152 evenChar :: Char -> Bool
139 153 evenChar = even . fromEnum

0 comments on commit 92f19c0

Please sign in to comment.
Something went wrong with that request. Please try again.