git.iko.soy/typeable/attoparsec
on master help sign in
Merge
commitfb90e79d0e3f12cef5cff4d5bc523a9295f24234 authorBryan O'Sullivan <bos@serpentine.com> dateSat 28 Mar 2015, 19:11 (12 years ago) parentbba639c2f1cf6e
2 files changed+14
tests/QC/ByteString.hs+7 tests/QC/Text.hs+7
tests/QC/ByteString.hs+7
@@ -66,6 +66,12 @@ string :: L.ByteString -> L.ByteString -> Property
6666string s t = parseBS (P.string s') (s `L.append` t) === Just s'
6767 where s' = toStrictBS s
6868
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+
6975skipWhile :: Word8 -> L.ByteString -> Property
7076skipWhile w s =
7177 let t = L.dropWhile (<=w) s
@@ -157,6 +163,7 @@ tests = [
157163 , testProperty "skip" skip
158164 , testProperty "skipWhile" skipWhile
159165 , testProperty "string" string
166+ , testProperty "strings" strings
160167 , testProperty "take" take
161168 , testProperty "takeByteString" takeByteString
162169 , testProperty "takeCount" takeCount
tests/QC/Text.hs+7
@@ -63,6 +63,12 @@ string :: L.Text -> L.Text -> Property
6363string s t = parseT (P.string s') (s `L.append` t) === Just s'
6464 where s' = toStrict s
6565
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+
6672stringCI :: T.Text -> Property
6773stringCI s = P.parseOnly (P.stringCI fs) s === Right s
6874 where fs = T.toCaseFold s
@@ -171,6 +177,7 @@ tests = [
171177 , testProperty "skip" skip
172178 , testProperty "skipWhile" skipWhile
173179 , testProperty "string" string
180+ , testProperty "strings" strings
174181 , testProperty "stringCI" stringCI
175182 , testProperty "take" take
176183 , testProperty "takeText" takeText