homepage: https://github.com/cjdev/hspec-expectations-match#readme
changelog-type: markdown
hash: 7588f7759c7aeb307a6167a9797682f4d991641227b3efedb4cf1d93e2cb8a33
test-bench-deps:
  base: -any
  hspec: -any
  hspec-expectations-match: -any
maintainer: Alexis King <lexi.lambda@gmail.com>
synopsis: An hspec expectation that asserts a value matches a pattern.
changelog: ! '# 0.1.0.0 (November 15th, 2017)


  - Initial release.

'
basic-deps:
  base: ! '>=4.9 && <5'
  transformers-base: <1
  template-haskell: ! '>=2.11 && <2.13'
  hspec-expectations: ! '>=0.3.2 && <1'
all-versions:
- '0.1.0.0'
author: Alexis King <lexi.lambda@gmail.com>
latest: '0.1.0.0'
description-type: markdown
description: ! '# hspec-expectations-match [![Build Status](https://travis-ci.org/cjdev/hspec-expectations-match.svg?branch=master)](https://travis-ci.org/cjdev/hspec-expectations-match)


  `hspec-expectations-match` is a Haskell package that provides a single expectation
  for use with [`hspec`][hspec], `shouldMatch`. The `shouldMatch` expectation uses
  Template Haskell to assert that a value matches a particular pattern.


  ```haskell

  {-# LANGUAGE TemplateHaskell #-}


  ghci> $([|Just True|] `shouldMatch` [p|Just _|])

  ghci> $([|Nothing|] `shouldMatch` [p|Just _|])

  *** Exception: Nothing failed to match pattern (Just x)

  ```


  Additionally, any bindings created by the pattern will be returned if the pattern
  is successfully matched, making it easier to extract the result of some assertion
  and use it to make further assertions.


  ```haskell

  ghci> $([|Just True|] `shouldMatch` [p|Just x|])

  True

  ghci> $([|[1, 2]|] `shouldMatch` [p|[x, y]|])

  (1, 2)

  ```


  For more information, [see the documentation on Hackage][hspec-expectations-match].


  [hspec]: https://hackage.haskell.org/package/hspec

  [hspec-expectations-match]: https://hackage.haskell.org/package/hspec-expectations-match

'
license-name: ISC

Update from Hackage at 2017-11-15T23:41:00Z
Update from Hackage at 2017-11-15T23:41:00Z
