inspection-testing-0.6.2: GHC plugin to do inspection testing

Safe Haskell | None
Language | Haskell2010

Test.Inspection.Plugin

Description

See Test.Inspection.

Synopsis

- plugin :: Plugin
- checkProperty :: ModGuts -> Name -> Property -> CoreM CheckResult
- data CheckResult
  - = ResSuccess
  - | ResSuccessWithMessage SDoc
  - | ResFailure SDoc
- prettyProperty :: (Name -> String) -> Name -> Property -> String

# Documentation

plugin :: Plugin Source #

The plugin. It supports some options:

- `-fplugin-opt=Test.Inspection.Plugin:keep-going` to keep building despite failing obligations
- `-fplugin-opt=Test.Inspection.Plugin:keep-going-O0` to keep building despite failing obligations, when optimisations are off
- `-fplugin-opt=Test.Inspection.Plugin:skip-O0` to skip performing inspections when optimisations are off
- `-fplugin-opt=Test.Inspection.Plugin:quiet` to be silent if all obligations are fulfilled

It makes sense to enable only one of `keep-going`, `keep-going-O0` and `skip-O0` at a time. `skip-O0` is useful when working with GHCi, to suppress inspection failure messages and eliminate the overhead of inspection when loading.

checkProperty :: ModGuts -> Name -> Property -> CoreM CheckResult Source #

data CheckResult Source #

Constructors

ResSuccess |
ResSuccessWithMessage SDoc |
ResFailure SDoc |

prettyProperty :: (Name -> String) -> Name -> Property -> String Source #