Popularity
6.8
Growing
Activity
0.0
Stable
14
6
3
Monthly Downloads: 14
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Latest version: v0.1.0.2
hspec-attoparsec alternatives and similar packages
Based on the "hspec" category.
Alternatively, view hspec-attoparsec alternatives based on common mentions on social networks and blogs.
-
hspec-checkers
Allows to use checkers properties from hspec -
hspec-expectations-json
Hspec expectations on JSON Values -
hspec-golden-aeson
Use tests to monitor changes in Aeson serialization -
hspec-megaparsec
Utility functions for testing Megaparsec parsers with Hspec -
hspec-hedgehog
Hedgehog support for the Hspec testing framework -
hspec-test-framework
Run test-framework tests with Hspec -
hspec-expectations-match
An hspec expectation that asserts a value matches a pattern -
hspec-expectations-pretty-diff
Catchy combinators for HUnit +++ colored pretty-printed diffs -
hspec-leancheck
LeanCheck support for the Hspec test framework. -
hspec-need-env
Read environment variables for hspec tests -
hspec-multicheck
A testing framework for Haskell using Hspec
Collect and Analyze Billions of Data Points in Real Time
Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.
Promo
www.influxdata.com
Do you think we are missing an alternative of hspec-attoparsec or a related project?
README
hspec-attoparsec
This (small) package provides handy functions for testing attoparsec parsers with hspec.
To see it in action, what better way is there than looking at hspec-attoparsec's own test suite!
{-# LANGUAGE OverloadedStrings #-}
module Test.Hspec.AttoparsecSpec where
import Control.Applicative
import Data.Attoparsec.Text
import Data.Text
import Test.Hspec
import Test.Hspec.Attoparsec
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "shouldParse" $
it "works on: \"x\" ~> char 'x'" $
("x" :: Text) ~> char 'x'
`shouldParse` 'x'
describe "parseSatisfies" $ do
it "works on: \"x\" and (=='x')" $
("x" :: Text) ~> char 'x'
`parseSatisfies` (=='x')
it "\">>>\" satisfies length == 3 when parser as a list of char" $
(">>>" :: Text) ~> many (char '>')
`parseSatisfies` ((==3) . Prelude.length)
describe "shouldFailOn" $
it "char 'x' fails on \"ha\"" $
char 'x' `shouldFailOn` ("ha" :: Text)
describe "shouldSucceedOn" $
it "char 'x' succeeds on \"x\"" $
char 'x' `shouldSucceedOn` ("x" :: Text)
describe "leavesUnconsumed" $
it "works on \"xa\" ~?> char 'x'" $
("xa" :: Text) ~?> char 'x'
`leavesUnconsumed` "a"
it "char 'x' leaves nothing unconsumed on \"x\"" $
("x" :: Text) ~?> char 'x'
`leavesUnconsumed` ""