git.iko.soy/typeable/attoparsec
on master help sign in
Merge
fb90e79Bryan O'Sullivan
tests/QC/ByteString.hs+7
@@ -66,6 +66,12 @@ string :: L.ByteString -> L.ByteString -> Property
66string s t = parseBS (P.string s') (s `L.append` t) === Just s'
66string s t = parseBS (P.string s') (s `L.append` t) === Just s'
67 where s' = toStrictBS s
67 where s' = toStrictBS s
68
68
69+strings :: L.ByteString -> L.ByteString -> L.ByteString -> Property
70+strings s t u =
71+ parseBS (P.string (toStrictBS s) >> P.string t') (L.concat [s,t,u])
72+ === Just t'
73+ where t' = toStrictBS t
74+
69skipWhile :: Word8 -> L.ByteString -> Property
75skipWhile :: Word8 -> L.ByteString -> Property
70skipWhile w s =
76skipWhile w s =
71 let t = L.dropWhile (<=w) s
77 let t = L.dropWhile (<=w) s
@@ -157,6 +163,7 @@ tests = [
157 , testProperty "skip" skip
163 , testProperty "skip" skip
158 , testProperty "skipWhile" skipWhile
164 , testProperty "skipWhile" skipWhile
159 , testProperty "string" string
165 , testProperty "string" string
166+ , testProperty "strings" strings
160 , testProperty "take" take
167 , testProperty "take" take
161 , testProperty "takeByteString" takeByteString
168 , testProperty "takeByteString" takeByteString
162 , testProperty "takeCount" takeCount
169 , testProperty "takeCount" takeCount
tests/QC/Text.hs+7
@@ -63,6 +63,12 @@ string :: L.Text -> L.Text -> Property
63string s t = parseT (P.string s') (s `L.append` t) === Just s'
63string s t = parseT (P.string s') (s `L.append` t) === Just s'
64 where s' = toStrict s
64 where s' = toStrict s
65
65
66+strings :: L.Text -> L.Text -> L.Text -> Property
67+strings s t u =
68+ parseT (P.string (toStrict s) >> P.string t') (L.concat [s,t,u])
69+ === Just t'
70+ where t' = toStrict t
71+
66stringCI :: T.Text -> Property
72stringCI :: T.Text -> Property
67stringCI s = P.parseOnly (P.stringCI fs) s === Right s
73stringCI s = P.parseOnly (P.stringCI fs) s === Right s
68 where fs = T.toCaseFold s
74 where fs = T.toCaseFold s
@@ -171,6 +177,7 @@ tests = [
171 , testProperty "skip" skip
177 , testProperty "skip" skip
172 , testProperty "skipWhile" skipWhile
178 , testProperty "skipWhile" skipWhile
173 , testProperty "string" string
179 , testProperty "string" string
180+ , testProperty "strings" strings
174 , testProperty "stringCI" stringCI
181 , testProperty "stringCI" stringCI
175 , testProperty "take" take
182 , testProperty "take" take
176 , testProperty "takeText" takeText
183 , testProperty "takeText" takeText