summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkoral <>2016-10-04 20:59:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2016-10-04 20:59:00 (GMT)
commit4685e169a0e25ba2ed6c7272d9226a14ebebc29a (patch)
tree43ea325fe8410cdafa71e4afddcf6eb0b62a19d5
parent7714cea6fbbad91d5a6c4f252a3314caf45112f3 (diff)
version 0.6.0.10.6.0.1
-rw-r--r--[-rwxr-xr-x]Text/OPML/Conduit/Parse.hs0
-rw-r--r--[-rwxr-xr-x]Text/OPML/Conduit/Render.hs0
-rw-r--r--[-rwxr-xr-x]Text/OPML/Lens.hs0
-rw-r--r--opml-conduit.cabal2
-rw-r--r--test/Arbitrary.hs24
5 files changed, 11 insertions, 15 deletions
diff --git a/Text/OPML/Conduit/Parse.hs b/Text/OPML/Conduit/Parse.hs
index 5a6515d..5a6515d 100755..100644
--- a/Text/OPML/Conduit/Parse.hs
+++ b/Text/OPML/Conduit/Parse.hs
diff --git a/Text/OPML/Conduit/Render.hs b/Text/OPML/Conduit/Render.hs
index 9786203..9786203 100755..100644
--- a/Text/OPML/Conduit/Render.hs
+++ b/Text/OPML/Conduit/Render.hs
diff --git a/Text/OPML/Lens.hs b/Text/OPML/Lens.hs
index 5236e35..5236e35 100755..100644
--- a/Text/OPML/Lens.hs
+++ b/Text/OPML/Lens.hs
diff --git a/opml-conduit.cabal b/opml-conduit.cabal
index ce27c7a..3961ce6 100644
--- a/opml-conduit.cabal
+++ b/opml-conduit.cabal
@@ -1,5 +1,5 @@
name: opml-conduit
-version: 0.6.0.0
+version: 0.6.0.1
synopsis: Streaming parser/renderer for the OPML 2.0 format.
description:
This library implements the OPML 2.0 standard (<http://dev.opml.org/spec2.html>) as a 'conduit' parser/renderer.
diff --git a/test/Arbitrary.hs b/test/Arbitrary.hs
index 392733b..6a7d3e9 100644
--- a/test/Arbitrary.hs
+++ b/test/Arbitrary.hs
@@ -39,9 +39,8 @@ deriving instance Generic Version
#endif
-- | OPML version may only be @1.0@, @1.1@ or @2.0@
-instance Arbitrary Version where
- arbitrary = Version <$> elements [ [1, 0], [1, 1], [2, 0] ] <*> pure []
- shrink = genericShrink
+genOPMLVersion :: Gen Version
+genOPMLVersion = Version <$> elements [ [1, 0], [1, 1], [2, 0] ] <*> pure []
-- | Reasonable enough 'URI' generator.
instance Arbitrary URI where
@@ -95,11 +94,9 @@ genTime = do
-- | Generates 'OutlineBase''s categories.
-- This generator makes sure that the result has no @,@ nor @/@ characters, since those are used as separators.
-instance Arbitrary (NonEmpty (NonNull Text)) where
- arbitrary = genCategoryPath
- where genCategory = genNonNull `suchThat` (isNothing . find (\c -> c == ',' || c == '/') . toNullable)
- genCategoryPath = (:|) <$> genCategory <*> listOf genCategory
- -- shrink = genericShrink
+genCategoryPath :: Gen (NonEmpty (NonNull Text))
+genCategoryPath = (:|) <$> genCategory <*> listOf genCategory where
+ genCategory = genNonNull `suchThat` (isNothing . find (\c -> c == ',' || c == '/') . toNullable)
-- | Alpha-numeric generator.
genAlphaNum :: Gen Char
@@ -131,13 +128,12 @@ instance Arbitrary OutlineBase where
<*> arbitrary
<*> arbitrary
<*> (Just <$> genTime)
- <*> arbitrary
- -- shrink = genericShrink
- shrink (OutlineBase _ b c d e) = OutlineBase <$> []
+ <*> listOf genCategoryPath
+ shrink (OutlineBase a b c d e) = OutlineBase <$> [a]
<*> shrink b
<*> shrink c
<*> shrink d
- <*> shrink e
+ <*> [e]
instance Arbitrary OutlineSubscription where
arbitrary = OutlineSubscription <$> arbitrary
@@ -158,10 +154,10 @@ instance Arbitrary OpmlOutline where
instance Arbitrary Opml where
arbitrary = do
degree <- choose (0, 100)
- Opml <$> arbitrary
+ Opml <$> genOPMLVersion
<*> arbitrary
<*> vectorOf degree (genOutlineTree 1)
- shrink = genericShrink
+ shrink (Opml a b c) = Opml <$> [a] <*> shrink b <*> shrink c
-- | Generate a tree of outlines with the given maximum depth.
-- This generator makes sure that only 'OpmlOutlineGeneric' may have children.