Skip to content
Snippets Groups Projects
Commit f2638095 authored by Oleg Grenrus's avatar Oleg Grenrus
Browse files

Add doctests for Parsec PkgconfigVersion

parent 9c4512dd
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,14 @@ instance NFData PkgconfigVersion where rnf = genericRnf ...@@ -40,6 +40,14 @@ instance NFData PkgconfigVersion where rnf = genericRnf
instance Pretty PkgconfigVersion where instance Pretty PkgconfigVersion where
pretty (PkgconfigVersion bs) = PP.text (BS8.unpack bs) pretty (PkgconfigVersion bs) = PP.text (BS8.unpack bs)
-- |
--
-- >>> simpleParsec "1.0.2n" :: Maybe PkgconfigVersion
-- Just (PkgconfigVersion "1.0.2n")
--
-- >>> simpleParsec "0.3.5+ds" :: Maybe PkgconfigVersion
-- Nothing
--
instance Parsec PkgconfigVersion where instance Parsec PkgconfigVersion where
parsec = PkgconfigVersion . BS8.pack <$> P.munch1 predicate where parsec = PkgconfigVersion . BS8.pack <$> P.munch1 predicate where
predicate c = isAsciiAlphaNum c || c == '.' || c == '-' predicate c = isAsciiAlphaNum c || c == '.' || c == '-'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment