Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bodigrim/tasty-inspection-testing
Integrate inspection-testing into tasty test suites
https://github.com/bodigrim/tasty-inspection-testing
compile-time-testing tasty testing
Last synced: 2 months ago
JSON representation
Integrate inspection-testing into tasty test suites
- Host: GitHub
- URL: https://github.com/bodigrim/tasty-inspection-testing
- Owner: Bodigrim
- License: mit
- Created: 2021-05-06T19:12:00.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-28T15:39:13.000Z (9 months ago)
- Last Synced: 2024-10-13T10:34:45.340Z (3 months ago)
- Topics: compile-time-testing, tasty, testing
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/tasty-inspection-testing
- Size: 18.6 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# tasty-inspection-tasting
Integrate [`inspection-testing`](http://hackage.haskell.org/package/inspection-testing)
into [`tasty`](http://hackage.haskell.org/package/tasty) test suites.```haskell
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -O -dsuppress-all -dno-suppress-type-signatures -fplugin=Test.Tasty.Inspection.Plugin #-}import Test.Tasty
import Test.Tasty.Inspectionlhs :: (a -> b) -> Maybe a -> Bool
lhs f x = case fmap f x of
Nothing -> True
Just{} -> Falserhs :: (a -> b) -> Maybe a -> Bool
rhs _ Nothing = True
rhs _ Just{} = Falsemain :: IO ()
main = defaultMain $(inspectTest $ 'lhs === 'rhs)
```Real world examples:
* https://hackage.haskell.org/package/random-1.2.1/src/test-inspection/Spec/Inspection.hs
* https://hackage.haskell.org/package/linear-base-0.2.0/src/test/Test/Data/V.hs
* https://hackage.haskell.org/package/text-2.0/src/tests/Tests/Properties/LowLevel.hs
* https://hackage.haskell.org/package/text-1.2.5.0/src/tests/Tests/Inspection/Strict.hs
* https://hackage.haskell.org/package/sized-1.0.0.1/src/test/opt-test.hs
* https://hackage.haskell.org/package/vector-0.13.0.0/src/tests-inspect/Inspect/DerivingVia.hs
* https://hackage.haskell.org/package/infinite-list-0.1/src/test/Fusion.hs