tasty-inspection-testing: Inspection testing support for tasty

[ library, mit, testing ] [ Propose Tags ] [ Report a vulnerability ]

Integrate inspection-testing into tasty test suites.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.1.0.1, 0.2, 0.2.1
Change log changelog.md
Dependencies base (<4.22), ghc (<9.13), inspection-testing (>=0.5 && <0.6), tasty (<1.6), template-haskell (<2.24) [details]
Tested with ghc ==9.8.1, ghc ==9.6.4, ghc ==9.4.8, ghc ==9.2.8, ghc ==9.0.2, ghc ==8.10.7, ghc ==8.8.4, ghc ==8.6.5, ghc ==8.4.4, ghc ==8.2.2, ghc ==8.0.2
License MIT
Copyright 2017 Joachim Breitner, 2021 Andrew Lelechenko
Author Joachim Breitner, Andrew Lelechenko
Maintainer Andrew Lelechenko <andrew.lelechenko@gmail.com>
Revised Revision 1 made by Bodigrim at 2024-12-03T23:40:09Z
Category Testing
Home page https://github.com/Bodigrim/tasty-inspection-testing
Bug tracker https://github.com/Bodigrim/tasty-inspection-testing/issues
Source repo head: git clone https://github.com/Bodigrim/tasty-inspection-testing
Uploaded by Bodigrim at 2024-01-27T15:50:55Z
Distributions Arch:0.2.1, LTSHaskell:0.2.1, NixOS:0.2.1, Stackage:0.2.1
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2842 total (74 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-01-27 [all 1 reports]

Readme for tasty-inspection-testing-0.2.1

[back to package description]

tasty-inspection-tasting

Integrate inspection-testing into tasty test suites.

{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -O -dsuppress-all -dno-suppress-type-signatures -fplugin=Test.Tasty.Inspection.Plugin #-}

import Test.Tasty
import Test.Tasty.Inspection

lhs :: (a -> b) -> Maybe a -> Bool
lhs f x = case fmap f x of
  Nothing -> True
  Just{}  -> False

rhs :: (a -> b) -> Maybe a -> Bool
rhs _ Nothing = True
rhs _ Just{}  = False

main :: IO ()
main = defaultMain $(inspectTest $ 'lhs === 'rhs)

Real world examples: